Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

What It Does

Each site you add is a proxy host: a domain name, and the address and port of the application that should answer it. Nginx Proxy Manager writes the Nginx configuration, requests and renews the certificate, and reloads Nginx for you. It suits a server with several containers or applications behind one public address. If you prefer to write the configuration by hand, see Nginx reverse proxy.

Before You Start

  • Docker with Compose: see how to install Docker on Ubuntu.
  • Ports 80 and 443 unused: stop any web server already listening there.
  • DNS: A records for your domains pointing at the server, so certificates can be issued.

The Compose File

Create a shared network first, so other containers can join it later:

docker network create proxy

Then a folder with this compose.yaml:

services:
  npm:
    image: jc21/nginx-proxy-manager:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:81:81"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

networks:
  default:
    name: proxy
    external: true
docker compose up -d

The data folder holds the settings database and the generated configuration; letsencrypt holds the certificates. Back up both.

Keep Port 81 Private

The admin interface is on port 81. The Compose file binds it to 127.0.0.1, which matters because ports published by Docker bypass UFW and firewalld (see Docker port mapping). Reach it through an SSH tunnel from your own computer:

ssh -L 8181:127.0.0.1:81 user@your_server_ip

Then open http://localhost:8181. How tunnels work is explained in SSH port forwarding.

First Login

Since version 2.13 there is no default account: the first visit opens a setup screen where you create the administrator account. Older versions signed you in with a default account and then asked you to change it. Either way, set your own login and a strong password at once, before you add any hosts. Advanced setups can create the first account from environment variables instead, as the project's advanced configuration page describes.

Add a Proxy Host

  1. Open Hosts, then Proxy Hosts, and click Add Proxy Host.
  2. Enter the domain name, the scheme (usually http), the forward host, and the forward port.
  3. Turn on Websockets Support if the application uses live updates.
  4. Turn on Block Common Exploits.
  5. Save and open the domain in a browser.

For a container on the proxy network, the forward host is the container's name, for example app and port 3000; the application's own port then needs no ports: entry at all. See Docker networks.

Request a Certificate

In the SSL tab of the proxy host, choose to request a new certificate, turn on Force SSL and HTTP/2 support, accept the Let's Encrypt terms, and save. Port 80 must be reachable from the internet for this check. Renewal is automatic. For a wildcard certificate, use the DNS challenge with your DNS provider's API token.

Access Lists

An access list adds a login prompt, an allow list of IP addresses, or both, to a proxy host. Use one for internal tools you put behind the proxy, such as a monitoring dashboard. The login prompt is HTTP basic authentication, so only use it with HTTPS turned on.

When Something Fails

  • 502 Bad Gateway: wrong forward host or port, or the application container is not on the same network.
  • Certificate request fails: DNS does not point at the server yet, or port 80 is blocked.
  • Logs: docker compose logs -f shows the container's output.
Was this answer helpful?
Loading...