Containers

Run Nginx Proxy Manager in Docker: Compose, SSL, Access Lists

Nginx Proxy Manager is the quickest way to put several Docker apps behind one Nginx with Let’s Encrypt certificates, and you never touch an Nginx config file. You run one container, open its admin UI, and every proxy host, certificate and access list you click together becomes a generated Nginx server block.

Original content from computingforgeeks.com - post 151975

This guide runs it with Docker Compose, requests a real certificate over HTTP-01, locks a host behind an access list, then proves those settings survive config regeneration, upgrades and a move to Rocky Linux with SELinux enforcing. We also ran it under Podman with a Quadlet unit. Every command below ran on Ubuntu 26.04 and Rocky Linux 10.2 in November 2026 against Nginx Proxy Manager 2.17.0.

Nginx Proxy Manager architecture diagram: visitors reach it on HTTPS 443, Let's Encrypt validates on HTTP 80, the admin connects through an SSH tunnel to port 81, and it forwards to the whoami container on port 80 with data and letsencrypt bind mounts on the Docker host

That is the whole setup you build here. One container owns ports 80 and 443, backends sit on its Docker network with no ports of their own, and all state lives in two bind mounts you can back up with one command.

Check what changed in the latest release

The current release is mostly a hardening and bug fix release, and two of its changes matter if you already run Nginx Proxy Manager. Access list rules and SSL settings used to go missing from host configs that were re-rendered in the background, and three DNS challenge plugins changed in ways that break existing certificates. The full list is in the official release notes; these are the items we tested in the lab:

  • Access list rules and SSL kept in re-rendered host configs
  • certificate_key removed from certificate API responses
  • Certificate validation now requires authentication
  • Rate limit on the login endpoint
  • certbot’s real failure reason shown instead of “Internal Error”
  • EdgeDNS, Beget and Infomaniak DNS plugins with breaking changes

The release notes describe the security fixes in plain words but carry no CVE or GHSA identifiers, so don’t go looking for one to put in a change ticket. The last release that listed CVE IDs was the 2.15.x line, which shipped the OpenResty fixes for CVE-2026-42945, CVE-2026-8711 and CVE-2026-9256. If you run anything older than that, upgrade before you do anything else in this guide.

Prerequisites

Nginx Proxy Manager needs ports 80 and 443 to itself, so run it on a host where nothing else listens there. The Let’s Encrypt HTTP-01 challenge also needs the domain to resolve to that host from the internet. You’ll need:

  • Ubuntu 26.04 / 24.04 or Rocky Linux 10 / AlmaLinux 10, amd64 or arm64
  • A DNS A record such as app.example.com pointing at the server
  • TCP 80 and 443 open from the internet, TCP 81 closed
  • A user with sudo and SSH access

The proxy itself is light, because OpenResty does the forwarding and the Node.js admin backend sits idle most of the time. What grows the footprint is the number of hosts, the access log volume under data/logs, and whatever backends share the box. The lab used small cloud VMs, which is a floor for testing, not a sizing target. For production, size the host for the apps behind it and give the logs their own disk budget. If your backends are on a home lab network, the proxy can live on any box that reaches them.

Install Docker Engine on Ubuntu

Use the apt repository from Docker rather than the docker.io package in the Ubuntu archive, so you get the Compose v2 plugin that the docker compose commands below expect. Start with the signing key:

sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Next, add the repository in the deb822 format. The codename is read from /etc/os-release, so the same line works on 24.04 and 26.04:

printf "Types: deb\nURIs: https://download.docker.com/linux/ubuntu\nSuites: %s\nComponents: stable\nSigned-By: /etc/apt/keyrings/docker.asc\n" "$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")" | sudo tee /etc/apt/sources.list.d/docker.sources

Install the engine and the Compose plugin, then add your user to the docker group so you can drop sudo from the docker commands. Log out and back in after the usermod for the group to apply.

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
docker --version
docker compose version

On our Ubuntu 26.04 VM the repository resolved to the resolute suite and installed these versions.

Docker version 29.9.3, build 5457199
Docker Compose version v5.7.1

If you’d rather follow a full walkthrough with the post-install checks, see installing Docker Compose on Ubuntu 26.04. For other distributions, the manual Compose plugin install covers the binary route.

Write the Docker Compose file

Everything Nginx Proxy Manager knows lives in two directories: data/ holds the SQLite database, generated Nginx configs, access list password files and logs, and letsencrypt/ holds the certificates and the ACME account. Keep both next to the Compose file so a backup is one tar of one directory.

mkdir -p ~/nginx-proxy-manager && cd ~/nginx-proxy-manager
vim docker-compose.yml

Paste the service definition. We pin the image to the exact tag instead of latest, because an unattended pull of a new major version is the last thing you want on the box that terminates TLS for everything else:

services:
  app:
    image: 'jc21/nginx-proxy-manager:2.17.0' # pin: tested release for this guide #https://github.com/NginxProxyManager/nginx-proxy-manager/releases
    restart: unless-stopped
    ports:
      - '80:80'   # public HTTP, also used for Let's Encrypt HTTP-01
      - '443:443' # public HTTPS
      - '81:81'   # admin UI, keep it off the internet
    environment:
      TZ: 'Africa/Nairobi'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

Set TZ to your own zone so log timestamps and certificate dates line up with your clock. This file uses the built-in SQLite database, which is what the official setup documentation starts with. MariaDB and PostgreSQL are supported too, but they only earn their keep when you have hundreds of hosts or want the database on a separate backup schedule.

Start Nginx Proxy Manager

Bring the stack up in the background. The first start pulls the image and creates a network named after the directory, nginx-proxy-manager_default, which we’ll attach the backend containers to later.

docker compose up -d
docker compose ps

The container should show Up with ports 80, 81 and 443 published.

NAME                        IMAGE                             COMMAND   SERVICE   CREATED          STATUS          PORTS
nginx-proxy-manager-app-1   jc21/nginx-proxy-manager:2.17.0   "/init"   app       28 seconds ago   Up 25 seconds   0.0.0.0:80-81->80-81/tcp, [::]:80-81->80-81/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp

Check the logs before you open the browser. On a fresh install the database migrations scroll past first. The tail shows the IP range fetch, the renewal timer starting and the backend reporting the port it listens on:

docker compose logs app | tail -6

The last line is the one that matters. Until it appears, the admin UI is not ready, so give it a few seconds after a fresh pull.

app-1  | [11/12/2026] [1:22:31 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
app-1  | [11/12/2026] [1:22:31 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
app-1  | [11/12/2026] [1:22:31 PM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
app-1  | [11/12/2026] [1:22:31 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
app-1  | [11/12/2026] [1:22:31 PM] [SSL      ] › ℹ  info      Completed SSL cert renew process
app-1  | [11/12/2026] [1:22:31 PM] [Global   ] › ℹ  info      Backend PID 237 listening on port 3000 ...

Now look at what’s listening on the host. Docker publishes all three ports on every interface, port 81 included:

sudo ss -tlnp | grep -E ":(80|81|443) "

Each port appears twice, once for IPv4 and once for IPv6, all owned by docker-proxy.

LISTEN 0      4096         0.0.0.0:443       0.0.0.0:*    users:(("docker-proxy",pid=3207,fd=8))
LISTEN 0      4096         0.0.0.0:81        0.0.0.0:*    users:(("docker-proxy",pid=3183,fd=8))
LISTEN 0      4096         0.0.0.0:80        0.0.0.0:*    users:(("docker-proxy",pid=3162,fd=8))
LISTEN 0      4096            [::]:443          [::]:*    users:(("docker-proxy",pid=3214,fd=8))
LISTEN 0      4096            [::]:81           [::]:*    users:(("docker-proxy",pid=3188,fd=8))
LISTEN 0      4096            [::]:80           [::]:*    users:(("docker-proxy",pid=3169,fd=8))

That 0.0.0.0:81 line is why the admin UI must sit behind a firewall you control outside the host, such as a cloud security group. A host firewall like UFW or firewalld does not help here, and the Rocky section below shows that with a real test. The tighter fix is to bind 81 to loopback, shown in the hardening section. Until then, create the admin account straight away, because whoever reaches the setup screen first owns the proxy.

Create the admin account

Since port 81 stays closed to the internet, reach the UI through an SSH tunnel from your workstation. This forwards local port 8181 to port 81 on the server:

ssh -N -L 8181:127.0.0.1:81 [email protected]

Open http://127.0.0.1:8181 in your browser. Current releases have no default [email protected] / changeme login any more, so older guides that tell you to use it are out of date. The first visit opens a setup screen where you create the only admin account:

Nginx Proxy Manager first-run Welcome screen asking for full name, email and a new password to create the admin account

Use a real email address you control here. It is not just a login name: Nginx Proxy Manager passes it to certbot as the Let’s Encrypt account email, and Let’s Encrypt refuses example.com addresses. We hit exactly that, as the troubleshooting section shows. Before setup, the status endpoint at /api/ reports "setup":false, which is a handy check from a script.

Add a proxy host for a container

To keep the demo neutral, the backend is traefik/whoami, a tiny web server that echoes the request it receives. Attach it to the Compose network so Nginx Proxy Manager can reach it by container name, and don’t publish any of its ports on the host:

docker run -d --name whoami --restart unless-stopped --network nginx-proxy-manager_default traefik/whoami
docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

whoami shows only 80/tcp, with no host mapping, so the proxy is the one way in.

NAMES                       IMAGE                             STATUS                  PORTS
whoami                      traefik/whoami                    Up Less than a second   80/tcp
nginx-proxy-manager-app-1   jc21/nginx-proxy-manager:2.17.0   Up About a minute       0.0.0.0:80-81->80-81/tcp, [::]:80-81->80-81/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp

In the UI, open Hosts > Proxy Hosts and click Add Proxy Host. Type the domain into Domain Names and press Enter so it turns into a tag, then set Forward Hostname / IP to whoami and Forward Port to 80. Turn on Block Common Exploits too. The domain is blurred in our screenshots.

Add Proxy Host Details tab in Nginx Proxy Manager forwarding a domain to the whoami container on port 80
  1. 1Domain Names
  2. 2Forward Hostname / IP
  3. 3Forward Port

The forward hostname is resolved inside the container, so localhost means Nginx Proxy Manager itself, not your server. Use a container name on the shared network, or the LAN address of the server, such as 10.0.1.50 for a service running outside Docker.

Leave Websockets Support off for whoami, but turn it on for any app that keeps a live connection open. Remote desktop sessions in Apache Guacamole and live sync in Vaultwarden both stall without it, so tick it when you put a Guacamole Docker Compose stack or a Vaultwarden server behind this proxy. The same headers appear in the hand-written configs for an Nginx proxy in front of Guacamole and for Vaultwarden with Nginx and Let’s Encrypt, if you want to compare. The toggle adds the Upgrade and Connection headers to the generated location block.

Request a Let’s Encrypt certificate

Stay in the same dialog and switch to the SSL tab. Pick Request a new Certificate from the SSL Certificate menu, then turn on Force SSL and HTTP/2 Support. We also turned on HSTS Enabled before saving. Only do that once you’re sure the domain will stay on HTTPS, because browsers remember it for two years.

SSL tab of a proxy host set to Request a new Certificate with Force SSL and HTTP/2 enabled
  1. 1SSL
  2. 2Request a new Certificate
  3. 3Force SSL and HTTP/2

Click Save. With HTTP-01, certbot places a token under /.well-known/acme-challenge/, Let’s Encrypt fetches it over port 80, and the certificate lands in letsencrypt/live/npm-<id>/. Ours took about 11 seconds from Save to a closed dialog, and the host list then showed the certificate and an Online status:

Proxy Hosts list showing the whoami host online with a Let's Encrypt certificate

Confirm it from outside rather than trusting the badge. The commands below ran from a workstation on the internet. We’ve replaced the lab domain with app.example.com in all output, and the client address with a documentation IP:

curl -sI http://app.example.com/
echo | openssl s_client -connect app.example.com:443 -servername app.example.com 2>/dev/null | openssl x509 -noout -issuer -dates

Plain HTTP now returns a 301 to HTTPS, which is Force SSL at work, and the certificate comes from Let’s Encrypt with the usual 90 day lifetime.

HTTP/1.1 301 Moved Permanently
Server: openresty
Date: Thu, 12 Nov 2026 10:43:30 GMT
Content-Type: text/html
Content-Length: 166
Connection: keep-alive
Location: https://app.example.com/

issuer=C=US, O=Let's Encrypt, CN=YE1
notBefore=Nov 12 09:45:32 2026 GMT
notAfter=Feb 10 09:45:31 2027 GMT

Renewal is automatic. The backend checks on start and on a timer for certificates that expire within 30 days, which you saw in the startup logs, so the only thing you have to keep working is inbound port 80.

Use a DNS challenge instead

HTTP-01 is the path we ran in the lab and the one to use when port 80 is reachable. Switch to DNS-01 when the proxy sits on a private network, when you want a wildcard such as *.example.com, or when port 80 is blocked upstream. Turn on Use DNS Challenge on the SSL tab, pick the provider and paste its API credentials into the box that appears. We didn’t issue a DNS-01 certificate in this lab, but the provider list below is what the installed release returned. $TOKEN is an API token; the API section shows how to get one.

curl -s -H "Authorization: Bearer $TOKEN" http://127.0.0.1:81/api/nginx/certificates/dns-providers | jq length

The endpoint returned 90 providers. These are the ones the release notes touch, plus the two most people use:

ProviderID in the APIWhat to do after upgrading
Akamai Edge DNSedgednsRecreate the certificate, then delete the old one
BegetbegetRecreate the certificate, then delete the old one
InfomaniakinfomaniakRecreate the certificate, then delete the old one
ScalewayscalewayNew provider, nothing to migrate
Route 53 (Amazon)route53No propagation seconds option any more
CloudflarecloudflareNothing
Hetzner / Hetzner Cloudhetzner / hetzner-cloudNot listed as breaking, but the Hetzner plugin jumped a major version, so test a renewal

The release warning for the first three is blunt: consider creating new DNS certificates with those providers and removing the old ones. Akamai Edge DNS now takes different credentials, Beget moved to another certbot plugin and Infomaniak got a new plugin version, so a renewal of an old certificate can fail quietly weeks later. Recreate them on the day you upgrade, while you’re watching.

Lock a host behind an access list

An access list combines HTTP basic auth users and IP allow or deny rules, and you attach it to any number of hosts. Open Access Lists, click Add Access List and give it a name on the Details tab. Add a user and password on the Authorizations tab. On the Rules tab, add an allow subnet rule for your office or VPN range:

Rules tab of a new Nginx Proxy Manager access list allowing one subnet before the implicit deny all
  1. 1Rules
  2. 2allow subnet

Note the deny all line the UI adds after your rules. On the Details tab, Satisfy Any decides how the two halves combine. With it on, a client from the allowed subnet gets in without a password and everyone else must log in. With it off, a client needs both. We turned it on, which is the usual “office walks in, remote staff log in” setup.

Now edit the proxy host and pick the list from the Access List menu on its Details tab:

Edit Proxy Host Details tab with the office-and-admins access list selected

Test it from a client outside the allowed subnet, once without credentials and once with them:

curl -s -o /dev/null -w '%{http_code}\n' https://app.example.com/
curl -s -u ops:Example-Pass-123 https://app.example.com/

The anonymous request gets a 401, and the authenticated one reaches whoami. Look at the headers whoami echoes back. Nginx Proxy Manager adds X-Forwarded-For and X-Forwarded-Proto: https, and the Authorization header is gone because Pass Auth to Upstream is off:

401
Hostname: 99b48f7f3b16
IP: 127.0.0.1
IP: ::1
IP: 172.18.0.3
RemoteAddr: 172.18.0.2:39144
GET / HTTP/1.1
Host: app.example.com
User-Agent: curl/8.18.0
Accept: */*
X-Forwarded-For: 203.0.113.25
X-Forwarded-Proto: https
X-Forwarded-Scheme: https
X-Real-Ip: 203.0.113.25

Leave Pass Auth to Upstream off unless the backend itself checks the same credentials. Turning it on hands every app behind the proxy a base64 copy of the shared password.

Confirm the rules survive config regeneration

Older releases had a nasty failure mode: when the backend re-rendered the config of a host in the background, the access list rules and the SSL block could drop out of the file. The proxy kept running, but the host was suddenly public and on plain HTTP. The current release says it fixes this, so we checked the generated file before and after a regeneration:

sudo grep -nE "auth_basic|allow |deny |ssl_certificate|Strict-Transport|http2" data/nginx/proxy_host/1.conf

The file holds the certificate paths, the basic auth file, the allow rule and the final deny.

28:  http2 on;
35:  ssl_certificate /etc/letsencrypt/live/npm-3/fullchain.pem;
36:  ssl_certificate_key /etc/letsencrypt/live/npm-3/privkey.pem;
50:  add_header Strict-Transport-Security $hsts_header_plain always;
82:    auth_basic            "Authorization required";
83:    auth_basic_user_file  /data/access/1;
94:    allow 10.0.1.0/24;
96:    deny all;
110:  add_header Strict-Transport-Security $hsts_header_plain always;

A container restart does not trigger a re-render: on start the image only adjusts IPv6 settings in the existing files. Neither did a certificate renewal through the API, since the modification time of the file stayed the same. Editing the access list does trigger one, because every host using that list gets its config rebuilt. So we added a second subnet through the API and grepped again (getting a token is covered in the next section):

curl -s -o /dev/null -w "PUT access-list HTTP %{http_code}\n" -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"name":"office-and-admins","satisfy_any":true,"pass_auth":false,"items":[{"username":"ops","password":""}],"clients":[{"directive":"allow","address":"10.0.1.0/24"},{"directive":"allow","address":"10.0.2.0/24"}]}' http://127.0.0.1:81/api/nginx/access-lists/1
sudo stat -c "%y %n" data/nginx/proxy_host/1.conf
sudo grep -nE "auth_basic |allow 10|deny all|ssl_certificate |http2 on" data/nginx/proxy_host/1.conf

The file was rewritten that second, and the new rule sits next to everything that was already there.

PUT access-list HTTP 200
2026-11-12 10:44:16.012780412 +0000 data/nginx/proxy_host/1.conf
28:  http2 on;
35:  ssl_certificate /etc/letsencrypt/live/npm-3/fullchain.pem;
82:    auth_basic            "Authorization required";
94:    allow 10.0.1.0/24;
96:    allow 10.0.2.0/24;
98:    deny all;

An empty password in items keeps the stored one, and the authenticated curl still returned 200 afterwards. Make this grep part of your upgrade checklist. It takes a second and catches a public host before anyone else does.

Query the API from a script

Everything in the UI is a call to the REST API under /api, which is handy for backups, audits and automation. Get a token by posting your credentials to /api/tokens. Keep them in a file readable only by you, so the password does not land in your shell history:

TOKEN=$(curl -s -H "Content-Type: application/json" -d @$HOME/.npm-cred.json http://127.0.0.1:81/api/tokens | jq -r .token)
curl -s -H "Authorization: Bearer $TOKEN" http://127.0.0.1:81/api/nginx/proxy-hosts | jq ".[] | {id, domain_names, forward_host, forward_port, certificate_id, access_list_id, ssl_forced, http2_support}"

The .npm-cred.json file holds {"identity":"[email protected]","secret":"..."}. The proxy host comes back with its domain list and the IDs of its certificate and access list:

{
  "id": 1,
  "domain_names": [
    "app.example.com"
  ],
  "forward_host": "whoami",
  "forward_port": 80,
  "certificate_id": 3,
  "access_list_id": 1,
  "ssl_forced": true,
  "http2_support": true
}

Certificates are where the API hardening shows. A certificate response no longer includes the private key, so a leaked admin token can’t be turned straight into a stolen key:

curl -s -H "Authorization: Bearer $TOKEN" http://127.0.0.1:81/api/nginx/certificates/3 | jq "{has_certificate_key: has(\"certificate_key\"), meta_keys: (.meta | keys)}"

Both the key field and the meta contents are absent from the response.

{
  "has_certificate_key": false,
  "meta_keys": []
}

Any script that used to read certificate_key from the API to copy keys elsewhere will now get nothing. Copy the files from letsencrypt/live/ on the host instead. The validate endpoint also refuses anonymous callers now. We uploaded a real certificate and key to it with no token:

curl -s -w "\nHTTP %{http_code}\n" -F certificate=@/tmp/c.pem -F certificate_key=@/tmp/k.pem http://127.0.0.1:81/api/nginx/certificates/validate

The request is rejected because it lacks the certificates:create permission:

{"error":{"code":403,"message":"Permission Denied"},"debug":{"stack":["Error: Permission Denied"],"previous":{"name":"Error","message":"Permission Denied","public":true,"status":403,"permission":"certificates:create"}}}
HTTP 403

Without any upload, the same anonymous call returns a 400 “No files were uploaded” instead. So if you probe it with an empty request, don’t read the 400 as the endpoint being open. Finally the login rate limit. We sent fifteen bad passwords in a row:

for i in $(seq 1 15); do printf "%2d " $i; curl -s -o /dev/null -w "%{http_code}\n" -H "Content-Type: application/json" -d "{\"identity\":\"[email protected]\",\"secret\":\"wrong-$i\"}" http://127.0.0.1:81/api/tokens; done
curl -s -i -H "Content-Type: application/json" -d '{"identity":"[email protected]","secret":"wrong"}' http://127.0.0.1:81/api/tokens | grep -iE "^HTTP|ratelimit|retry-after|^\{"

Ten failures come back as 400, then the limiter takes over with 429 and a Retry-After header:

 1 400
 2 400
...
10 400
11 429
12 429
...
15 429
HTTP/1.1 429 Too Many Requests
Retry-After: 56
{"error":{"code":429,"message":"Too many login attempts. Please try again in 1 minute."}}

The correct password also got a 429 inside that window, and logins worked again about a minute later. Keep that in mind for monitoring scripts that log in on every run. A misconfigured one will lock out the human admin for a minute at a time.

Upgrade Nginx Proxy Manager without losing data

An upgrade is a tag change and a pull, because all state lives in the two bind mounts. To prove that, we built this same stack on the previous release line, with the whoami host, the access list and a real Let’s Encrypt certificate issued over HTTP-01, then upgraded it with the steps below. Before you touch anything, write down which certificate the proxy serves, so you have something to compare against afterwards:

cd ~/nginx-proxy-manager
sudo ls -R letsencrypt/live
echo | openssl s_client -connect 127.0.0.1:443 -servername app.example.com 2>/dev/null | openssl x509 -noout -issuer -serial -enddate

Each certificate gets an npm-<id> folder named after its ID in the database. Ours was certificate 3:

letsencrypt/live:
README
npm-3

letsencrypt/live/npm-3:
README
cert.pem
chain.pem
fullchain.pem
privkey.pem
issuer=C=US, O=Let's Encrypt, CN=YE2
serial=0603CEA4C562C2E744693A9765E53022C16C
notAfter=Feb 10 10:48:42 2027 GMT

Now stop the container and back up first, so a bad migration is a one-command rollback. Don’t skip the tarball because the next step usually works: it is the only copy of your certificates and ACME account if it doesn’t.

cd ~/nginx-proxy-manager
docker compose stop
sudo tar czf ~/npm-backup-$(date +%F).tar.gz data letsencrypt docker-compose.yml
ls -lh ~/npm-backup-*.tar.gz

The archive is small with one host and one certificate. Yours will grow with logs and certificates.

-rw-r--r-- 1 root root 35K Nov 12 11:47 /home/josphat/npm-backup-2026-11-12.tar.gz

Change the tag to the release you want, whatever tag you run now, then pull and recreate the container. The status endpoint tells you which version came up:

sed -i -E "s#(jc21/nginx-proxy-manager):[0-9.]+#\1:2.17.0#" docker-compose.yml # pin: target release #https://github.com/NginxProxyManager/nginx-proxy-manager/releases
docker compose pull
docker compose up -d
until curl -s http://127.0.0.1:81/api/ | grep -q status; do sleep 2; done
curl -s http://127.0.0.1:81/api/
docker compose logs app | grep -E "Migrat|Backend PID" | tail -6

Only one migration ran, the one that adds the stricter permission metadata, and "setup":true confirms the existing admin was kept:

{"status":"OK","setup":true,"version":{"major":2,"minor":17,"revision":0}}
app-1  | [11/12/2026] [2:48:36 PM] [Migrate  ] › ℹ  info      Current database version: none
app-1  | [11/12/2026] [2:48:36 PM] [Migrate  ] › ℹ  info      [user_permission_meta] Migrating Up...
app-1  | [11/12/2026] [2:48:36 PM] [Migrate  ] › ℹ  info      [user_permission_meta] user_permission Table altered
app-1  | [11/12/2026] [2:48:37 PM] [Global   ] › ℹ  info      Backend PID 241 listening on port 3000 ...

Don’t let Current database version: none scare you. The migrator printed that line on the first start of a brand new database and again on this upgrade, even though our database already had 19 recorded migrations in its migrations table before the upgrade and 20 after it, so it does not mean the database came up empty.

Then run the same certificate check as before, make an authenticated HTTPS request, get a fresh token and confirm the host still carries its certificate and access list, both in the database and in the generated file:

sudo ls -R letsencrypt/live
echo | openssl s_client -connect 127.0.0.1:443 -servername app.example.com 2>/dev/null | openssl x509 -noout -issuer -serial -enddate
curl -s -o /dev/null -w "HTTPS %{http_code} %{ssl_verify_result}\n" -u ops:Example-Pass-123 https://app.example.com/
TOKEN=$(curl -s -H "Content-Type: application/json" -d @$HOME/.npm-cred.json http://127.0.0.1:81/api/tokens | jq -r .token)
curl -s -H "Authorization: Bearer $TOKEN" "http://127.0.0.1:81/api/nginx/proxy-hosts?expand=access_list" | jq ".[] | {id, domain_names, forward_host, certificate_id, access_list: .access_list.name}"
sudo grep -nE "server_name|ssl_certificate |auth_basic |allow 10|deny all" data/nginx/proxy_host/1.conf

The npm-3 folder is still there, and the serial and expiry match the pre-upgrade check, so the proxy serves the very certificate it had before rather than a fresh one. HTTPS 200 0 means the request passed basic auth and certificate verification returned 0, which is OK. The host still points at certificate 3 and the access list, and the generated file still has the ssl_certificate path, the auth and the allow rule. This test stack never got the second subnet from the regeneration check, so expect an extra allow 10.0.2.0/24 line and different line numbers in yours:

letsencrypt/live:
README
npm-3

letsencrypt/live/npm-3:
README
cert.pem
chain.pem
fullchain.pem
privkey.pem
issuer=C=US, O=Let's Encrypt, CN=YE2
serial=0603CEA4C562C2E744693A9765E53022C16C
notAfter=Feb 10 10:48:42 2027 GMT
HTTPS 200 0
{
  "id": 1,
  "domain_names": [
    "app.example.com"
  ],
  "forward_host": "whoami",
  "certificate_id": 3,
  "access_list": "office-and-admins"
}
23:  server_name app.example.com;
32:  ssl_certificate /etc/letsencrypt/live/npm-3/fullchain.pem;
73:    auth_basic            "Authorization required";
85:    allow 10.0.1.0/24;
87:    deny all;

If a migration ever goes wrong, stop the container, restore the tarball over the directory, put the old tag back and start it again. Don’t try to run the old image against a database the new one has already migrated.

Run it on Rocky Linux with SELinux enforcing

Rocky Linux, AlmaLinux and RHEL add two things to think about: SELinux labels on the bind mounts, and firewalld, which does not stop ports that Docker publishes. Our Rocky VM ran SELinux in enforcing mode. Its cloud image had firewalld in the trusted zone, so we moved the interface to public to match a normal server, then opened HTTP and HTTPS only. On a standard install the default zone is already public and you can skip the first two commands. If you do need them, replace eth0 with your interface name from firewall-cmd --get-active-zones:

sudo firewall-cmd --set-default-zone=public
sudo firewall-cmd --zone=public --change-interface=eth0 --permanent
sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload
sudo firewall-cmd --list-services

Port 81 is not in the list, and SSH is still allowed.

cockpit dhcpv6-client http https ssh

Install Docker CE from the upstream RHEL repository, which works on Rocky and AlmaLinux too. If dnf complains about container-selinux, see the container-selinux dependency fix.

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo systemctl enable --now docker
sudo docker info --format "{{.SecurityOptions}}"

Docker and Compose came out at the same versions as on Ubuntu, but look at the security options. There is no selinux entry:

[name=seccomp,profile=builtin name=cgroupns]

That matters more than any volume flag. With SELinux support off in the daemon, Docker ignores :Z and runs the container as spc_t, an unconfined type. We started the stack with :Z on both volumes and found the directories still labelled user_home_t and the Node.js process running as system_u:system_r:spc_t:s0. It works, but SELinux is not protecting anything.

To get real confinement, enable SELinux in the daemon. This is the whole file:

sudo vim /etc/docker/daemon.json

Add the one setting, or merge it into the file if you already have one:

{ "selinux-enabled": true }

Next, write the Compose file for Rocky. We kept it in ~/nginx-proxy-manager/compose.yaml; run mkdir -p ~/nginx-proxy-manager && cd ~/nginx-proxy-manager and open compose.yaml in vim. It has :Z on both volumes and binds the admin port to loopback:

services:
  app:
    image: jc21/nginx-proxy-manager:2.17.0 # pin: tested release for this guide #https://github.com/NginxProxyManager/nginx-proxy-manager/releases
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:81:81"
    environment:
      TZ: "Africa/Nairobi"
    volumes:
      - ./data:/data:Z
      - ./letsencrypt:/etc/letsencrypt:Z

Restart the daemon, recreate the container, and check the labels on the directories and the process:

sudo systemctl restart docker
sudo docker compose up -d --force-recreate
ls -dZ data letsencrypt
sudo ps -eZ | grep node-MainThread

Now Docker relabels both directories to container_file_t with a private MCS pair, and the process runs confined as container_t with the same pair:

system_u:object_r:container_file_t:s0:c178,c227 data
system_u:object_r:container_file_t:s0:c178,c227 letsencrypt
system_u:system_r:container_t:s0:c178,c227 9329 ? 00:00:02 node-MainThread

Leave :Z off with SELinux enabled and you get a container that looks healthy but is not. We ran a second copy without it: docker inspect reported running restarts=0, yet the logs were full of denials and the admin port never answered:

mkdir: cannot create directory '/data/nginx': Permission denied
mkdir: cannot create directory '/data/custom_ssl': Permission denied
mkdir: cannot create directory '/data/logs': Permission denied
mkdir: cannot create directory '/data/access': Permission denied

So if a fresh install on Rocky shows “running” but port 81 hangs, check docker logs for Permission denied before you blame the network. Use :Z on directories only this container uses. Never use it on a shared path like your home directory, because the relabel locks other processes out of it.

Now the firewalld test. We started a throwaway container publishing port 8083, which is not open in the public zone, and requested it from another VM in the same network:

from proxy01 to :8083 HTTP 200
from proxy01 to :81 HTTP 000
from proxy01 to :80 HTTP 200

Port 8083 answered even though firewalld never allowed it, because Docker puts its interfaces in its own docker zone and forwards published ports itself. Port 81 failed only because Compose bound it to 127.0.0.1. The lesson holds on Ubuntu with UFW too: the bind address controls exposure, not the host firewall.

Run Nginx Proxy Manager with Podman

Podman ships in the Rocky and AlmaLinux repositories and needs no daemon. We ran the image rootful, because Nginx Proxy Manager has to bind ports 80 and 443. The cleanest way to run it as a service is a Quadlet unit, which systemd turns into a normal service at boot. If you followed the Docker steps on the same host, take that stack down and stop Docker first so ports 80 and 443 are free, then install Podman:

sudo docker compose -f ~/nginx-proxy-manager/compose.yaml down
sudo systemctl disable --now docker docker.socket
sudo dnf -y install podman
sudo mkdir -p /opt/npm/data /opt/npm/letsencrypt
sudo vim /etc/containers/systemd/npm.container

Paste the unit. Unlike Docker, Podman honours :Z with no extra setting, and the image name needs its registry prefix:

[Unit]
Description=Nginx Proxy Manager
Wants=network-online.target
After=network-online.target

[Container]
ContainerName=npm
# pin: tested release for this guide #https://github.com/NginxProxyManager/nginx-proxy-manager/releases
Image=docker.io/jc21/nginx-proxy-manager:2.17.0
PublishPort=80:80
PublishPort=443:443
PublishPort=127.0.0.1:81:81
Environment=TZ=Africa/Nairobi
Volume=/opt/npm/data:/data:Z
Volume=/opt/npm/letsencrypt:/etc/letsencrypt:Z

[Service]
Restart=always

[Install]
WantedBy=multi-user.target default.target

Reload systemd so the generator picks up the file, then start the service. There’s no enable step, because the [Install] section takes care of boot:

sudo systemctl daemon-reload
sudo systemctl start npm.service
sudo systemctl status npm.service --no-pager | head -3

The unit shows as generated from the .container file.

● npm.service - Nginx Proxy Manager
     Loaded: loaded (/etc/containers/systemd/npm.container; generated)
     Active: active (running) since Thu 2026-11-12 10:52:55 UTC; 24s ago

Podman labelled /opt/npm/data as container_file_t and ran the backend as container_t with no daemon change at all. After a reboot, the service came back on its own:

uptime -s
systemctl is-active npm.service
curl -s http://127.0.0.1:81/api/
getenforce

New boot time, active unit, the API answering and SELinux still enforcing.

2026-11-12 10:53:47
active
{"status":"OK","setup":false,"version":{"major":2,"minor":17,"revision":0}}
Enforcing

To upgrade under Podman, change the tag in the Image= line, run daemon-reload, and restart the service. The backup advice from the Docker section applies unchanged to /opt/npm.

Troubleshooting

Certbot failed: The ACME server believes [email protected] is an invalid email address

This is the first error most people hit on a test install, and older releases hid it behind “Internal Error”. The current release shows the reason from certbot in the dialog. Ours read: Certbot failed: Unable to register an account with ACME server. The ACME server believes [email protected] is an invalid email address. The email comes from your admin user, so change it under Users to a real address and save the host again. The address only matters the first time, when certbot registers the ACME account. Once a request succeeds, later requests reuse that account and never check the email again.

HTTP-01 challenge fails with a timeout or 404

Let’s Encrypt could not fetch the token on port 80. Work through these in order before you retry, because each failed attempt counts against the Let’s Encrypt rate limits for your domain.

  1. The A record points at this server, checked with dig +short app.example.com
  2. Port 80 is open in your cloud firewall or security group
  3. No CDN proxy or redirect sits in front of the domain

Then run curl -I http://app.example.com/.well-known/acme-challenge/test from outside. It should reach openresty, even if it returns 404. If it times out, the problem is the network, not Nginx Proxy Manager. The full certbot output lands in docker compose logs app, next to the reason the UI shows you.

DNS-01 renewal fails after an upgrade

If the provider is Akamai Edge DNS, Beget or Infomaniak, recreate the certificate as described in the DNS challenge section; renewing the old one won’t fix it. For other providers, the usual cause is propagation. Except on Route 53, which no longer has the option, raise the propagation seconds field so certbot waits longer before asking Let’s Encrypt to check the TXT record, and confirm the API token can edit that zone. The error from the provider now shows in the UI instead of a generic failure.

Too many login attempts. Please try again in 1 minute.

That’s the login rate limit, and it blocks the right password too. Wait for the Retry-After seconds to pass, then find whatever is retrying with stale credentials. In our test that was about a minute, and nothing needs to be reset on the server.

mkdir: cannot create directory ‘/data/nginx’: Permission denied

SELinux is blocking the container from writing the bind mount. Add :Z to both volumes and recreate the container. On Docker this only matters when selinux-enabled is on in daemon.json. Under Podman it’s always on.

Harden the deployment

The default Compose file is fine for a first run, but the admin port and the image tag deserve attention before the proxy carries real traffic. In order of impact:

  1. Bind the admin UI to loopback: 127.0.0.1:81:81
  2. Pin the image tag and upgrade on purpose
  3. Back up data/ and letsencrypt/ before every upgrade
  4. Grep the host configs for auth_basic and deny all after it
  5. Give monitoring scripts their own user

For the first item, change the admin line under ports in docker-compose.yml to - '127.0.0.1:81:81' and run docker compose up -d to recreate the container. The SSH tunnel from the admin section keeps working, because it already targets 127.0.0.1:81.

The loopback bind is the one that counts. We showed that neither firewalld nor UFW stops a port Docker publishes, so 127.0.0.1 plus an SSH tunnel is the only setup that keeps port 81 private whatever happens to your cloud firewall. If you’d rather not run a GUI proxy at all, Caddy gives you automatic HTTPS from a text file. But for a handful of containers and people who’d rather click than write config, Nginx Proxy Manager with these five habits is what I’d run.

Keep reading

PHP2Shell and CVE-2026-115560 on EOL PHP 8.1, 8.0 and 7.4 Php PHP2Shell and CVE-2026-115560 on EOL PHP 8.1, 8.0 and 7.4 Best UI Applications for Managing Docker Containers Containers Best UI Applications for Managing Docker Containers Install Docker and Run Containers on Ubuntu 24.04|22.04 Containers Install Docker and Run Containers on Ubuntu 24.04|22.04 OpenShift 5 New Features Tested on a Single Node Cluster Containers OpenShift 5 New Features Tested on a Single Node Cluster Drupal SA-CORE-2026-019 (CVE-2026-136716): Check and Patch Security Drupal SA-CORE-2026-019 (CVE-2026-136716): Check and Patch Copy Kubernetes Secrets Between Namespaces Containers Copy Kubernetes Secrets Between Namespaces

Leave a Comment

Press ESC to close