How to fix Error response from daemon: pids limit is not supported on this platform in Docker

DockerINTERMEDIATELOWUpdated Dec 6, 2025ยท 271 views

This error occurs when you try to use the --pids-limit flag on a system where the Linux kernel does not have the pids cgroup controller enabled. The fix involves enabling CGROUP_PIDS in your kernel configuration or switching to cgroup v2 with proper systemd delegation.

Quick fix

Fixes Error response from daemon: pids limit is not supported on this platform

# Check if pids controller is available
cat /proc/cgroups | grep pids
  1. Check kernel support for pids cgroup
  2. Check cgroup version and mount points
  3. Upgrade to a supported kernel version
  4. Enable cgroup v2 (recommended for rootless Docker)
docker โ€” error
# Check if pids controller is available
cat /proc/cgroups | grep pids
Error response from daemon: pids limit is not supported on this platform

What this error means

The "pids limit is not supported on this platform" error indicates that Docker cannot enforce a process ID (PID) limit on your containers because your Linux kernel lacks support for the pids cgroup controller. The pids cgroup controller was introduced in Linux kernel 4.3 and allows limiting the number of processes that can be created within a cgroup (and thus within a Docker container). This feature is crucial for preventing fork bombs, where a malicious or buggy process creates processes indefinitely until system resources are exhausted. Docker requires the kernel to be compiled with CONFIG_CGROUP_PIDS=y to enable this functionality. Without it, the --pids-limit flag on docker run, the pids_limit option in Docker Compose v2, or the deploy.resources.limits.pids option in Docker Compose v3/Swarm cannot be used. This error is common on older Linux kernels, some minimal or embedded Linux distributions, and when running Docker in rootless mode on cgroup v1 systems.

Typical symptoms

  • docker run --pids-limit fails with 'pids limit is not supported on this platform'
  • Docker Compose services with pids_limit fail to start
  • docker info shows 'WARNING: No pids cgroup support'
  • Container resource limits work for memory and CPU but not for PIDs
  • Fork bomb protection is not available for containers

Common causes

  1. Linux kernel compiled without CONFIG_CGROUP_PIDS=y support
  2. Running Docker on an older kernel (pre-4.3) that lacks pids cgroup controller
  3. Docker running in rootless mode on cgroup v1 without proper delegation
  4. Minimal or embedded Linux distribution with limited cgroup support
  5. Windows or macOS Docker Desktop in certain configurations
  6. Systemd not delegating pids cgroup controller to user sessions

How to fix "Error response from daemon: pids limit is not supported on this platform"

1Check kernel support for pids cgroup

First, verify whether your kernel supports the pids cgroup controller:

bash
# Check if pids controller is available
cat /proc/cgroups | grep pids

If this returns a line like pids 0 1 1, the pids controller is available. If it returns nothing, your kernel lacks support.

Also check Docker's view of cgroup support:

bash
docker info | grep -i pids

You can also check kernel configuration:

bash
# If available on your system
zcat /proc/config.gz | grep CGROUP_PIDS
# Or check boot config
grep CGROUP_PIDS /boot/config-$(uname -r)

If CONFIG_CGROUP_PIDS is not set to 'y', your kernel needs to be recompiled or upgraded.

2Check cgroup version and mount points

Determine which cgroup version your system uses:

bash
# Check cgroup version
stat -fc %T /sys/fs/cgroup/

- Output cgroup2fs means cgroup v2 (unified hierarchy)
- Output tmpfs means cgroup v1 (legacy hierarchy)

For cgroup v1, check if pids controller is mounted:

bash
mount | grep cgroup | grep pids
# or
ls /sys/fs/cgroup/pids

If the pids controller is not mounted, you may need to mount it manually or update your kernel.

3Upgrade to a supported kernel version

The pids cgroup controller requires Linux kernel 4.3 or later. Check your current kernel version:

bash
uname -r

If you're on an older kernel, upgrade to a newer version:

Ubuntu/Debian:

bash
sudo apt update
sudo apt upgrade linux-generic
sudo reboot

RHEL/CentOS/Fedora:

bash
sudo dnf upgrade kernel
# or for older versions
sudo yum upgrade kernel
sudo reboot

For minimal distributions, you may need to install a full kernel package or recompile the kernel with CONFIG_CGROUP_PIDS=y enabled.

4Enable cgroup v2 (recommended for rootless Docker)

If you're running Docker in rootless mode, cgroup v2 is strongly recommended as it provides better support for resource limits including pids.

Enable cgroup v2 in GRUB:

bash
# Edit GRUB configuration
sudo nano /etc/default/grub

# Add or modify this line
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=1"

# Update GRUB
sudo update-grub  # Debian/Ubuntu
# or
sudo grub2-mkconfig -o /boot/grub2/grub.cfg  # RHEL/CentOS

# Reboot
sudo reboot

After reboot, verify cgroup v2 is active:

bash
stat -fc %T /sys/fs/cgroup/
# Should output: cgroup2fs
5Configure systemd cgroup delegation for rootless Docker

For rootless Docker with cgroup v2, you need to enable delegation of cgroup controllers to user sessions:

bash
# Create systemd configuration directory
sudo mkdir -p /etc/systemd/system/user@.service.d

# Create delegation configuration
sudo tee /etc/systemd/system/user@.service.d/delegate.conf << 'EOF'
[Service]
Delegate=cpu cpuset io memory pids
EOF

# Reload systemd
sudo systemctl daemon-reload

# Restart user session or reboot
loginctl terminate-user $USER

After logging back in, verify the controllers are delegated:

bash
cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/user@$(id -u).service/cgroup.controllers

You should see pids in the output.

6Test pids limit functionality

After applying the fixes, verify that pids limit now works:

bash
# Check Docker's capabilities
docker info 2>&1 | grep -i pids

# Test running a container with pids limit
docker run --rm --pids-limit=100 alpine cat /sys/fs/cgroup/pids.max

# For cgroup v1 systems
docker run --rm --pids-limit=100 alpine cat /sys/fs/cgroup/pids/pids.max

The output should show 100 (or max if no limit is set).

For Docker Compose, test with:

yaml
version: '2.4'
services:
  test:
    image: alpine
    command: cat /sys/fs/cgroup/pids.max
    pids_limit: 100

Or for Compose v3 with Swarm mode:

yaml
version: '3.9'
services:
  test:
    image: alpine
    deploy:
      resources:
        limits:
          pids: 100
7Alternative: Remove pids limit from configuration

If you cannot upgrade your kernel or enable pids support, you can remove the pids limit from your Docker configuration as a workaround:

For docker run:

bash
# Remove --pids-limit flag
docker run --memory=512m <image>  # Without --pids-limit

For Docker Compose v2:

yaml
version: '2.4'
services:
  app:
    image: myapp
    # Remove pids_limit line
    mem_limit: 512m

For Docker Compose v3:

yaml
version: '3.9'
services:
  app:
    image: myapp
    deploy:
      resources:
        limits:
          memory: 512M
          # Remove pids: line

Warning: Without pids limits, containers are vulnerable to fork bombs. Consider implementing application-level process limits or using ulimits as a partial mitigation:

bash
docker run --ulimit nproc=100 <image>

Advanced notes

Understanding the pids cgroup controller: The pids controller limits the number of process IDs (PIDs) that can be allocated within a cgroup. This directly limits the number of processes and threads that can exist simultaneously. When the limit is reached, fork() and clone() system calls fail with EAGAIN.

Docker Compose version differences: The pids_limit option has different support across Compose versions:
- Compose v2.x files (version: '2.4'): Use pids_limit: 100 directly on the service
- Compose v3.x files: Use deploy.resources.limits.pids: 100 (only works in Swarm mode)
- Non-Swarm v3: Use docker compose run with docker-compose.override.yml containing v2.4 syntax, or use docker container update --pids-limit 100 <container> after start

Rootless Docker limitations on cgroup v1: When running rootless Docker on cgroup v1, the --cpus, --memory, and --pids-limit flags are silently ignored. This is because non-root users cannot access the cgroup filesystem in v1. Migrating to cgroup v2 with proper delegation is the only solution.

Kernel compilation: If you're building a custom kernel, ensure these options are enabled:

bash
CONFIG_CGROUPS=y
CONFIG_CGROUP_PIDS=y

Kubernetes considerations: In Kubernetes, PID limits can be configured at the kubelet level using the --pod-max-pids flag (deprecated) or podPidsLimit in kubelet configuration. This requires kernel support on all nodes:

yaml
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
podPidsLimit: 1024

Security implications: Without pids limits, a container can create unlimited processes, potentially:
- Exhausting system PIDs (default max is 32768 on many systems)
- Causing denial of service to other containers and the host
- Making the system unresponsive through fork bombs

Consider enabling pids limits as part of your container security baseline.

Frequently asked questions

What does "Error response from daemon: pids limit is not supported on this platfo" mean?
The "pids limit is not supported on this platform" error indicates that Docker cannot enforce a process ID (PID) limit on your containers because your Linux kernel lacks support for the pids cgroup controller. 3 and allows limiting the number of processes that can be created within a cgroup (and thus within a Docker container). This feature is crucial for preventing fork bombs, where a malicious or buggy process creates processes indefinitely until system resources are exhausted.
How do I fix "Error response from daemon: pids limit is not supported on this platfo"?
This error occurs when you try to use the --pids-limit flag on a system where the Linux kernel does not have the pids cgroup controller enabled. The fix involves enabling CGROUP_PIDS in your kernel configuration or switching to cgroup v2 with proper systemd delegation.
What causes "Error response from daemon: pids limit is not supported on this platfo"?
Linux kernel compiled without CONFIG_CGROUP_PIDS=y support Running Docker on an older kernel (pre-4.3) that lacks pids cgroup controller Docker running in rootless mode on cgroup v1 without proper delegation
Is the "Error response from daemon: pids limit is not supported on this platfo" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading