The NET_ADMIN capability in this Docker Compose file:
cap_add:
- NET_ADMINis a Linux capability that grants the container elevated privileges to manage network-related operations. It's one of many fine-grained permissions that containers can be granted in a secure way, without giving them full root access.
It allows the container to perform actions like:
- Configure network interfaces (e.g.
ip addr,ifconfig, etc.) - Set up routes
- Modify firewall rules (e.g.
iptables) - Create virtual network devices (e.g.
tun,tap) - Use tools like
tc(traffic control)
CapRover uses Docker's internal networking to route traffic to deployed apps and sometimes configures things like custom firewall rules or manages ports behind the scenes. The NET_ADMIN capability is required for:
- Handling reverse proxy configurations
- Managing firewall/NAT rules for internal/external app exposure
- Possibly configuring iptables when setting up SSL or routing
Without NET_ADMIN, some of those network-level operations might fail inside the container, breaking CapRover’s ability to route traffic correctly or bind services.
Granting NET_ADMIN gives the container significant control over the host’s network stack. It should only be used with trusted images, like caprover/caprover, which is a well-maintained project. Avoid using this flag in random or third-party images unless absolutely necessary.
Let me know if you want to run CapRover without NET_ADMIN and work around it with host networking or adjusted Docker privileges — it’s possible in some use cases.