Skip to main content

ufw-docker rule ignored

Updated 1 min readMarkdown

Every time I restarted the container, ufw-docker apparently trashed the rule. This is bad, as if something really bad happened, I don't want my service left inaccessible.

How to fix this? Simple, just put the ufw-docker command into the crontab. Do sudo crontab -e , then put the command below to run it every minute.

* * * * * ufw-docker allow traefik 80 && ufw-docker allow traefik 443 2>&1 | systemd-cat -t cron-ufw

Then log it using journalctl -t cron-ufw:

Done.

132 views

About the author

No comments yet. Be the first to comment.