Nginx Proxy Manager (NPM) is an open-source Docker image that lets you run a reverse proxy and can even handle SSL certificates for you using Let’s Encrypt. It’s great when you can’t use a Cloudflare Tunnel or an Entra App Proxy. I’ve been using Nginx Proxy Manager for a while now, and it’s been perfect for what I need.
In this post, I will show you step-by-step how to setup Nginx Proxy Manager with Docker and configure a Proxy Host, Redirection Host, 404 Host, add a custom SSL certificate, and enable SSL.
Prerequisites
- Access to the DNS for the domains you want to use.
- Access to create port forwards for port 80 and 443.
- Docker host.
Initial Setup
- Make a folder to store your configurations for Nginx Proxy Manager.
- Make a new
docker-compose.yml
file.
- Copy the contents of the
docker-compose.yml
file from the NPM documentation here.
Your docker-compose.yml
file should look something like this.
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
Code language: YAML (yaml)
The docker compose file will create a folder named data
in the location where the docker-compose.yml
file is. The data folder holds the SQLite database for NPM, log files and other configuration files. A folder named letsencrypt
will also be created, where your Let’s Encrypt data is stored.
- Run the following command to start the Nginx Proxy Manager docker container
docker compose up -d
- Go to the address of your Docker host on port 81 to access the NPM admin interface.
- Login with the default admin user.
Email: [email protected]
Password: changeme
Code language: plaintext (plaintext)
You will be forced to change it on the first login.
- Change the user details as needed.
- Change the password.