-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ufw-docker not stopping Docker from opening ports #125
Comments
On ubuntu 24.10 as well.
because I use a dedicated docker network for them all, with nginx proxy manager in front and the rest behind. I modified
I disabled ufw and modified the pi-hole docker-compose.yml to expose port 53 on the wireguard ip and localhost. It also says in https://docs.docker.com/engine/install/ubuntu/#firewall-limitations Docker is only compatible with iptables-nft and iptables-legacy. Firewall rules created with nft are not supported on a system with Docker installed. Make sure that any firewall rulesets you use are created with iptables or ip6tables, and that you add them to the DOCKER-USER chain |
I do not get ufw-docker to work on both a Raspberry Pi (Debian 11) or a VPS (Debian 12).
This is what I do:
Install Docker without starting any containers
Stop Docker
Install ufw-docker
Restart UFW
Start Docker
Verify /etc/ufw/after.rules
Reboot server
Start containers using Portainer stacks (Docker Compose)
Containers are automatically accessible outside localhost
Taking Pi-Hole as an example, DNS is accessible, GUI is accessible and iptables lists this:
iptables -L | grep pi.hole
ACCEPT tcp -- anywhere pi.hole tcp dpt:domain
ACCEPT udp -- anywhere pi.hole udp dpt:domain
ACCEPT tcp -- anywhere pi.hole tcp dpt:http
This is not expected behaviour, and I do not know how to fix it.
The text was updated successfully, but these errors were encountered: