Exposed docker ports not accessible on public IP


I have installed Docker on a VPS running Debian and I’m trying to expose one of the ports from the container to the host.

While it is accessible on, when I try to connect to it using the public IP of the VPS, it is not accessible.

This is a fresh install of Debian, so no firewall is active or anything like that.

Does anybody know why this is the case?

Many thanks.

Can you show how you do it? If you mean you use the “expose” parameter or Dockerfile instruction, that is not enough. You need to forward ports.

So if you can run for example curl to access the service, it means that you either forwarded the port from your localhost only, or you do have some firewall even if you did not install any.


So this is my docker composer file:

version: "3.3"
      - "./data:/data"
      - "./config:/config"
      - VPN_ENABLED=yes
      - VPN_CLIENT=openvpn
      - VPN_PROV=custom
      - LAN_NETWORK=
      - DEBUG=true
      - "7000:8080"
      - "7001:8118"
      - NET_ADMIN
    image: binhex/arch-qbittorrentvpn

And the ports are binding to So, it should work right? Not sure why it is not. What would I have to do to forward the ports to the public IP?

You don’t forward port TO the public IP but FROM the public IP TO the container. Since your container has NET_ADMIN capability and you also use VPN, try an other container without VPN just to make sure that the port forward works with a simple container like nginx so you can open the main page from the browser using the public IP.