1. Prepare the Server
On Ubuntu 24.04, secure the server and install Docker. Point each domain you will serve at the server's IP address with an A record, and allow ports 80 and 443. Nothing else may be listening on those ports, so stop any Nginx or Apache already installed.
2. Start Nginx Proxy Manager
In ~/npm/compose.yaml:
services:
app:
image: 'jc21/nginx-proxy-manager:2.17.1'
restart: unless-stopped
environment:
TZ: "America/New_York"
ports:
- '80:80'
- '443:443'
- '127.0.0.1:81:81' # admin interface, on the server only
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencryptcd ~/npm docker compose up -d docker compose logs -f app # the first start can take a minute
The tag is the release current when this was written; use the newest from the project's setup page, and update deliberately. The official example publishes port 81 to the world; the 127.0.0.1: prefix keeps it private, which matters because Docker opens published ports past ufw (see why ufw does not block Docker ports).
3. Sign In to the Admin Interface
# on your own computer ssh -L 8181:127.0.0.1:81 [email protected] # then open http://localhost:8181
On the first visit, set up the administrator account with your own email address and a strong password, as the interface asks, and turn on two-factor authentication if your version offers it.
4. Add a Site With HTTPS
- Open Hosts → Proxy Hosts → Add Proxy Host.
- Enter the domain, the scheme the app speaks (usually
http), and where it listens: for a container on the same server, its container name and port, with both containers on the same Docker network. - Turn on Websockets Support for apps that need it, such as chat and dashboards.
- On the SSL tab, request a new Let's Encrypt certificate, and turn on Force SSL and HTTP/2. Save.
To reach other containers by name, put them on a shared network:
docker network create proxy
# then in each compose.yaml, including Nginx Proxy Manager's:
networks:
default:
name: proxy
external: trueIf the certificate fails, the domain usually does not point at the server yet or port 80 is blocked; see fixing certificate validation errors.
Backups and What to Run Behind It
The data and letsencrypt folders hold every host, certificate and account; back them up with the rest of the server. Good first apps behind it: Uptime Kuma, Vaultwarden, Umami and n8n. How many fit on one server is covered in how many websites a VPS can host.