Nginx Proxy Manager is a reverse proxy with a web interface. It runs in Docker, receives the visits to your domains on ports 80 and 443, sends each domain to the right app on your server, and gets free Let's Encrypt certificates for them. You add a site by filling in a form instead of writing nginx configuration files.
We installed version 2.17.1 with Docker Compose on 2 December 2026, on an Ubuntu 26.04.1 server with Docker 29.10.1. Then we put a test app behind it at test.nexaforge.si with a certificate from the Cloudflare DNS challenge, checked HTTPS from the command line, and reset the admin login from the database. Every screenshot below comes from that test.
Quick answer: Nginx Proxy Manager setup in six steps
- Install Docker Engine and the Docker Compose plugin.
- Save the docker-compose.yml file below in a folder and run
docker compose up -d. - Open http://your-server-ip:81 and create the admin account. Version 2.17.1 has no default login.
- For the certificate, either point the domain at your public IP address and forward ports 80 and 443 to the server (HTTP challenge), or create an API token at your DNS provider (DNS challenge, works with closed ports).
- Open Hosts > Proxy Hosts > Add Proxy Host and enter the domain, the app's container name and its port.
- In the SSL tab, choose Request a new Certificate and Force SSL, then Save.
What you need
- A Linux server or home server with Docker. We used Ubuntu 26.04.1 LTS, Docker 29.10.1 and Docker Compose v5.8.1.
- Ports 80 and 443 free on the server: Nginx Proxy Manager listens on them. Port 81 is its admin page.
- A domain name. With the HTTP challenge, the domain must point at your public IP address and your router must forward ports 80 and 443 to the server. With the DNS challenge, you need an API token from your DNS provider instead. We used Cloudflare.
Step 1: Install Docker and Docker Compose
Install Docker Engine and the Compose plugin from Docker's own repository: our guide Install Docker Compose on Ubuntu shows each command. Then check both versions:
docker --version
docker compose version
Step 2: Create the docker-compose.yml file and start it
Make a folder for Nginx Proxy Manager (we used ~/npm), save this file in it as docker-compose.yml, then start it from that folder:
services:
app:
image: 'jc21/nginx-proxy-manager:2.17.1'
restart: unless-stopped
ports:
- '80:80' # HTTP
- '443:443' # HTTPS
- '81:81' # admin web interface
environment:
TZ: 'Etc/UTC'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
whoami:
image: 'traefik/whoami:v1.12.0'
restart: unless-stoppeddocker compose up -d
What each part does:
- image:
jc21/nginx-proxy-manageris the project's official image. Like the project's own example, the file pins version 2.17.1, so an update only happens when you change the tag. - ports: 80 and 443 receive the visits, 81 opens the admin page.
- TZ: the time zone of the logs.
- volumes:
./datakeeps the database, the settings and the logs;./letsencryptkeeps the certificates. Back up both folders: together they are your whole setup. - whoami: a tiny test app (
traefik/whoami) that answers with the request it received. It proves that the proxy works; put your own apps in its place later.
The first start pulled the Nginx Proxy Manager image in 188 seconds on our connection, then both containers started in under two seconds.
Step 3: First login (there is no default login any more)
Open http://your-server-ip:81 in a browser. Version 2.17.1 has no default account: the first page says "Welcome! Get started by creating your admin account." and asks for a full name, an email address and a new password.

The login [email protected] with the password changeme belongs to older releases; in 2.17.1 the first start asks you to create the account instead. To skip this page on a new install, the image can create the account from two environment variables, INITIAL_ADMIN_EMAIL and INITIAL_ADMIN_PASSWORD, described in the project's advanced configuration page.
After Save, the dashboard opens with no host yet:

Keep port 81 for your own network: do not forward it on your router. If you need the admin page from outside, reach it through a VPN.
Step 4: Create a Cloudflare API token for the DNS challenge
Let's Encrypt only gives a certificate to someone who controls the domain, and it checks this in one of two ways. With the HTTP challenge, it connects to your server on port 80, so the server must be reachable from the internet. With the DNS challenge, Nginx Proxy Manager writes a temporary TXT record through your DNS provider's API, so the server can stay closed to the internet; it is also the only way to get a wildcard certificate. Our test server is not reachable from the internet, so we used the DNS challenge with Cloudflare, which hosts the domain's DNS.
- In the Cloudflare dashboard, open My Profile, then API credentials > API tokens, and click Create token.
- Give the token a name and pick the template Edit zone DNS.
- In the policy, keep Include, choose Specific zone and select your domain. The template's only permission is DNS: Edit.
- Choose an expiration, then click Continue to summary.

The summary shows the zone and the permission before anything is created:

Click Create Token and copy the token at once: Cloudflare shows it only once.

We chose 7 days because we deleted the token after the test. On a real server, choose a longer period or none: Nginx Proxy Manager needs the token again at every renewal, and an expired token cannot renew the certificate. Never paste your Global API Key here: this token can only edit the DNS records of one zone.
Step 5: Add a proxy host
In Nginx Proxy Manager, open Hosts > Proxy Hosts and click Add Proxy Host. In the Details tab:
- Domain Names: type the domain (test.nexaforge.si in our test) and press Enter.
- Scheme http, Forward Hostname / IP
whoami, Forward Port 80: where the app answers inside Docker. - Turn on Block Common Exploits.

The forward hostname is the service name because both services are in the same docker-compose.yml: Docker Compose put them in one network (npm_default in the output of Step 2), where each service name leads to its container. For an app in another compose file, add both containers to a shared Docker network, or use the server's IP address and the port the app publishes. Turn on Websockets Support for apps that need it, such as Home Assistant.
Step 6: Get a free SSL certificate with the DNS challenge
Open the SSL tab of the same form:
- SSL Certificate: Request a new Certificate.
- Turn on Force SSL and HTTP/2 Support.
- Turn on Use DNS Challenge and pick Cloudflare as the DNS Provider.
- In Credentials File Content, replace the example token after
dns_cloudflare_api_token=with yours. Leave Propagation Seconds empty. - Click Save.

The form warns that the credentials are stored as plain text in the database and in a file, one more reason to use a token that can only edit DNS. Leave HSTS off until HTTPS works on every name of the domain: once a browser has seen HSTS, it refuses plain HTTP for that name for as long as the header says, usually months.
Save took about a minute. The container's log shows why: on first use, Nginx Proxy Manager installed Certbot's Cloudflare plugin (20 seconds), then Certbot created the TXT record, waited 10 seconds for DNS propagation and received the certificate. The host then showed Online with a Let's Encrypt certificate:

The Certificates page lists it with its provider and its expiry date, 90 days later:

Step 7: Check that HTTPS works
From a computer on the internet, open https://your-domain: the browser should show the app with a valid padlock. Our test server is not reachable from the internet, so we ran the checks on the server itself; the --resolve option of curl sends the domain to the local address 127.0.0.1. First, both containers must be up:
docker compose ps --format 'table {{.Service}}\t{{.Image}}\t{{.Status}}'
Then plain HTTP, HTTPS, and what the app behind the proxy receives:
curl -sI --resolve test.nexaforge.si:80:127.0.0.1 http://test.nexaforge.si/
curl -sI --resolve test.nexaforge.si:443:127.0.0.1 https://test.nexaforge.si/
curl -s --resolve test.nexaforge.si:443:127.0.0.1 https://test.nexaforge.si/ | grep -E '^(Hostname|Host|X-Forwarded-Proto):'
Plain HTTP answers 301 with Location: https://test.nexaforge.si/: Force SSL works. HTTPS answers HTTP/2 200 from openresty, the nginx build inside Nginx Proxy Manager. The whoami lines show what the app receives: the original Host and X-Forwarded-Proto: https, so an app behind the proxy knows that the visitor used HTTPS.
Last, the certificate itself:
echo | openssl s_client -connect 127.0.0.1:443 -servername test.nexaforge.si 2>/dev/null | openssl x509 -noout -subject -issuer -dates
It is issued for CN=test.nexaforge.si by Let's Encrypt and is valid from 2 December 2026 to 2 March 2027.
Forgot password: reset the Nginx Proxy Manager login
Nginx Proxy Manager has no "forgot password" link and sends no reset email. With the SQLite database of the compose file above, you can make it ask for a new admin account: mark the existing users as deleted, then start it again. Run this in the folder that holds docker-compose.yml:
docker compose stop app
sudo sqlite3 data/database.sqlite "SELECT id, email, is_deleted FROM user;"
sudo sqlite3 data/database.sqlite "UPDATE user SET is_deleted = 1;"
docker compose start app
If sqlite3 is missing, install it first with sudo apt install sqlite3. The database file belongs to root because the container writes it, hence sudo.
Open port 81 again: the Welcome page is back. Create the new admin account:

After the new login, the proxy host and its certificate were still there and online:

The database keeps the old account, marked as deleted, and the site answers again over HTTPS:
sudo sqlite3 data/database.sqlite "SELECT id, email, is_deleted FROM user;"
curl -sI --resolve test.nexaforge.si:443:127.0.0.1 https://test.nexaforge.si/ | head -1
We tested this with the SQLite database only; a setup with MySQL, MariaDB or PostgreSQL needs that database's own client.
Nginx Proxy Manager vs Caddy vs Traefik
All three are reverse proxies that get Let's Encrypt certificates by themselves; they differ in how you set them up. This table comes from each project's documentation, and we tested only Nginx Proxy Manager here.
| Nginx Proxy Manager | Caddy | Traefik | |
|---|---|---|---|
| Set up with | a web interface on port 81 | a text file, the Caddyfile | labels on each container, or configuration files |
| HTTPS | a certificate per host, requested in the interface (HTTP or DNS challenge) | automatic for every site in the Caddyfile | automatic once a certificate resolver is set in its configuration |
| Best for | a few apps, managed by clicking | a few sites, with the configuration kept as text | many containers that start and stop often |
Frequently asked questions
What is the default login for Nginx Proxy Manager?
There is none in version 2.17.1. On the first visit to port 81 you create the admin account with a name, an email address and a password. The pair [email protected] and changeme comes from older releases.
What ports does Nginx Proxy Manager use?
80 and 443 for the sites and 81 for the admin page, as in the ports of the compose file. Forward 80 and 443 on your router for the HTTP challenge; never forward 81.
Does Nginx Proxy Manager renew the certificates?
Yes: its documentation says it uses Certbot to issue and renew Let's Encrypt certificates. With the DNS challenge, the renewal uses the same API token, so the token must still be valid when the certificate is renewed.
Can Nginx Proxy Manager get a wildcard certificate?
Let's Encrypt issues wildcard certificates (such as *.example.com) only through the DNS challenge, which in Nginx Proxy Manager is the setup of Step 6. We requested a single name in this test.
Why does Nginx Proxy Manager show 502 Bad Gateway?
The proxy could not reach the app: the forward hostname or port is wrong, the app is stopped, or the two containers are not in the same Docker network. Compare the Details tab with the app's container name and the port it listens on inside the container.
How do I update Nginx Proxy Manager?
Back up the data and letsencrypt folders, change the version in the image line of docker-compose.yml, then run docker compose pull and docker compose up -d. The settings and certificates stay in the two folders.
How do I see the visitor's real IP address behind Nginx Proxy Manager?
Behind Cloudflare, the app first sees Cloudflare's addresses. Our guide Fix Nginx Proxy Manager Real IP Behind Docker and Cloudflare shows the settings that pass the real address through.
Related guides
- Fix Nginx Proxy Manager Real IP Behind Docker and Cloudflare
- Install Docker Compose on Ubuntu using Docker’s repository
- Docker Compose Up: Start Containers and Check They Work
- Vaultwarden Docker Compose: HTTPS, Admin Token and Backups
- Home Assistant Docker Compose: Port 8123 and Remote Access
- Cloudflare Zero Trust 101: Access for Self-Hosted Apps
Sources
- Nginx Proxy Manager docs: full setup instructions
- Nginx Proxy Manager docs: advanced configuration
- Nginx Proxy Manager docs: Certbot DNS plugins
- Cloudflare docs: create an API token
- Let's Encrypt docs: challenge types
- Certbot Cloudflare DNS plugin docs
- Caddy docs: automatic HTTPS
- Traefik docs: Docker provider
Leave a comment
Your email address will not be published. Required fields are marked *
