Open up Docker ports in UFW

My home Docker installation had some ports blocked internally for a project I was working on today. The sequence of commands listed below will allow the containers to communicate internally while still keeping open outgoing connection and not changing any incoming UFW rules.

sudo ufw allow in on docker0
sudo ufw enable
sudo iptables -t nat -A POSTROUTING ! -o docker0 -s -j MASQUERADE

Original source link:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.