I am installing Docker Desktop on my Debian 12 computer, but first I need to install Docker Engine. I’ve understood everything about setting up Docker Desktop and Docker Engine, except for one crucial aspect, the Firewall limitations in the “Install Docker Engine on Debian” documentation.
This is what I have gathered and understood so far:
-
When Docker exposes container ports, it does not honor the rules or configurations set by
ufw(Uncomplicated Firewall) or byfirewalld. This means that even if I set up a specific rule, for example withufw, Docker can still expose those ports, bypassing my firewall rules. -
Firewall rules should be created using
iptablesorip6tablesand added to theDOCKER-USERchain.
Here is the part where my confusion begins:
-
What does “only compatible with
iptables-nftandiptables-legacy” mean here exactly? I need some elaboration here since the next sentence then says: “Firewall rules created withnftare not supported on a system with Docker installed.” -
Should I install
iptables-nftand set it up before installing the Docker Engine? Or does it not matter?- In Packet filtering and firewalls and it says that “Docker creates
iptablesandip6tablesrules to implement network isolation, port publishing and filtering.” Does that meaniptablesgets installed and configured automatically when installing Docker?
- In Packet filtering and firewalls and it says that “Docker creates
Any clarification or help will be greatly appreciated, thank you.
I apologize in advance if the wording of my understanding and questioning isn’t the best. I do have some experience with Docker before but I am still a beginner. The biggest project I’ve ever worked on was installing Docker Engine through ssh on a Raspberry Pi to setup Pi-hole.