Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Firewall with Docker on Ubuntu
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Firewall with Docker on Ubuntu

rasping5978rasping5978 Member
edited April 2023 in Help

Hi, I recently purchased my new VPS running Ubuntu 22. I have a public IPv4 address. I have set up Docker on Ubuntu and was able to spin up my services. However, those exposed ports are publicly on the internet and anyone can access through :. I don't want the service port to be exposed so I set up Nginx Proxy Manager as my reverse proxy. It works but service port is still exposed.

I then used a firewall (ufw) and only allow 80 and 443, however it still doesn't block. Searched up and looks like its a bug for Docker and ufw. Now I used ufw-docker, yes it blocks my Docker services from the public network. Now I want to continue to only proxy my services through the reverse proxy. However it still does not seem to work. I tried adding a nginxproxymanager bridge network and having all my Docker containers use that bridge network, however nginxproxymanager could not seem to reach the other containers.

At this point I feel like giving up hahaha I am not sure what is the cause, is it Ubuntu, ufw-docker, or Docker? I am accessing the VPS though Wireguard and it works as expected. Yay.

What is the best practices for setting up Ubuntu, Docker on a VPS? What other tips would you provide? I have set up password-less authentication on SSH too and set up 2FA on my provider.

For context I have my homelab set up using my home IP. I am trying to have a similar set up on a VPS, where the server directly have the public IP, unlike a home network where it goes through a firewall/router. My local server can expose services internally eg 192.168.1.20:9999 without exposing it to the public internet.

Thank you!

Comments

Sign In or Register to comment.