Nginx Proxy Manager (NPM) provides a web UI for managing reverse proxies and free Let's Encrypt SSL certificates — ideal for hosting several websites or applications on one VPS without hand-editing Nginx configuration files.
Prerequisites
- Docker Engine and Docker Compose installed
- A domain name pointing to your VPS
- Root or sudo access
Step 1 — Create a Project Directory
mkdir ~/nginx-proxy-manager && cd ~/nginx-proxy-manager
mkdir data letsencrypt
Step 2 — Create docker-compose.yml
nano docker-compose.yml
services:
app:
image: jc21/nginx-proxy-manager:latest
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
- "80:80"
- "81:81"
- "443:443"
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
Step 3 — Start the Container
docker compose up -d
Step 4 — Allow the Admin Port Through the Firewall
sudo ufw allow 81/tcp
Step 5 — Access the Admin Panel
http://YOUR_SERVER_IP:81
Step 6 — Log In and Change the Default Credentials
Default login:
| Password | |
|---|---|
| [email protected] | changeme |
You'll be forced to set a new email and password immediately after first login — do not skip this.
Step 7 — Add a Proxy Host
- Go to Proxy Hosts → Add Proxy Host
- Enter your domain name
- Set the forward hostname/IP and port of your backend application (e.g. another container or
127.0.0.1:3000) - Enable WebSocket Support if your app requires it
- Save
Step 8 — Enable Free SSL
- Edit the Proxy Host, open the SSL tab
- Request a new Let's Encrypt certificate
- Enable Force SSL and HTTP/2
- Save
Common Errors
Port 80/443 already in use:
sudo ss -tulpn | grep -E ':80|:443'
Stop any other web server (Nginx/Apache) running directly on the host before starting NPM.
Can't access port 81 — confirm the firewall rule was added: sudo ufw status.
SSL request fails — confirm your domain's DNS A record already points to this server's IP before requesting a certificate.
Best Practices
- Change the default admin credentials immediately
- Enable HTTPS (Force SSL) on every hosted domain
- Back up the
dataandletsencryptdirectories regularly
FAQ
Can I host multiple domains through one Nginx Proxy Manager instance?
Yes — that's its primary purpose; add a separate Proxy Host entry for each domain or subdomain.
Related Articles
- How to Install Docker Compose on Ubuntu & Debian
- How to Install Portainer for Web-Based Docker Management
- Deploy WordPress with Docker Compose
