
Verdict Cepat / TL;DR: Setting up Nginx Proxy Manager (NPM) on your VPS gives you a clean web dashboard to manage reverse proxies, automatic Let’s Encrypt SSL certificates, and custom subdomains without touching raw NGINX configuration files. By running NPM inside Docker Compose alongside a shared container network, you can route domain traffic directly to your backend services securely with zero downtime.
If you run multiple web applications, Docker containers, or self-hosted tools on a single Virtual Private Server (VPS), exposing them directly through open public ports is bad security practice. Running services on non-standard ports like 8080, 9000, or 3000 leaves your infrastructure cluttered and vulnerable. Raw NGINX virtual host files solve this, but editing configuration blocks by hand for every new subdomain quickly becomes tedious and prone to syntax errors.
Nginx Proxy Manager bridges this gap. It wraps a full NGINX reverse proxy engine in a sleek, lightweight web interface. With NPM, pointing app.yourdomain.com to an internal Docker container takes under thirty seconds. It handles automatic SSL renewal via Let’s Encrypt, HTTP to HTTPS redirection, access control lists, and custom location headers with a few clicks.
When combined with Docker, NPM acts as the single gateway for your entire server. Instead of exposing five different ports on your public IP firewall, you keep port 80 and 443 open for NPM and keep all backend container traffic strictly on an isolated internal network.
Before installing Nginx Proxy Manager, ensure your VPS setup satisfies these basic requirements:
Before launching NPM, configure your domain’s DNS settings so traffic reaches your VPS IP address. Log into your DNS provider and add two primary records:
@ pointing to your VPS public IPv4 address (e.g., 192.0.2.1).* pointing to the same VPS public IPv4 address (e.g., 192.0.2.1).Using a wildcard record (*.yourdomain.com) ensures that any new subdomain you create later (like analytics.yourdomain.com or dashboard.yourdomain.com) immediately routes to your server without waiting for DNS propagation.
To let Nginx Proxy Manager forward traffic to other Docker containers by service name instead of host ports, all containers must share an internal Docker network. Create a bridge network called proxy-network by running this command in your terminal:
docker network create proxy-networkThis isolated bridge network acts as a virtual switch. Containers attached to proxy-network can communicate with each other securely over internal hostnames without publishing their ports to the public internet.
Create a dedicated directory for NPM on your VPS and create a docker-compose.yml file:
mkdir -p ~/npm && cd ~/npm
nano docker-compose.ymlPaste the following production-ready Docker Compose configuration:
version: '3.8'
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
networks:
- proxy-network
networks:
proxy-network:
external: trueSave and exit the editor. Launch the stack in detached mode:
docker compose up -dVerify that the container is running smoothly by checking the status:
docker psOnce the container is running, open your web browser and navigate to your VPS IP address on port 81 (the administration console):
http://YOUR_VPS_IP:81Log in using the default administrator credentials:
[email protected]changemeImmediately upon your first login, NPM will force you to enter a valid admin email address and create a strong, custom password. Complete this step straight away to secure your administrative dashboard.
Now that NPM is active, you can proxy incoming web traffic to any container or backend service. Here is how to route a domain to a web app with automated SSL:
app.yourdomain.com) and press Enter.http (or https if your backend requires it).my-web-app) if attached to proxy-network, or 172.17.0.1 (Docker gateway) for host services.3000).NPM will validate the domain ownership via HTTP-01 challenge, issue a free SSL certificate, write the NGINX configuration automatically, and reload the proxy engine in seconds.
| Feature | Raw NGINX | Nginx Proxy Manager | Caddy Server |
|---|---|---|---|
| Management Interface | CLI / Config files | Web GUI + API | CLI / Caddyfile |
| SSL Automation | Manual (Certbot CLI) | Automated (Click GUI) | Automated (Built-in) |
| Resource Usage | Extremely minimal (<30 MB) | Lightweight (<150 MB) | Minimal (<50 MB) |
| Docker Integration | Manual static IP mapping | Docker network DNS support | Requires plugin / labeling |
| Access Control Lists | Manual htpasswd / auth directives | Built-in GUI ACLs & Basic Auth | Caddyfile block rules |
| Learning Curve | Moderate to High | Very Low | Low to Moderate |
To ensure maximum security for your reverse proxy infrastructure, apply these three essential protection layers:
Port 81 should never be accessible to the public internet. Block port 81 publicly and only allow access from your specific home/office IP address:
sudo ufw deny 81/tcp
sudo ufw allow from YOUR_HOME_IP to any port 81 proto tcpAlternatively, you can create a Proxy Host inside NPM itself for npm.yourdomain.com pointing to 127.0.0.1:81 with SSL enabled, and close port 81 in your firewall entirely.
For sensitive backend tools like database viewers or administrative dashboards, navigate to Access Lists in NPM. Create a rule requiring HTTP Basic Auth username/password credentials or whitelist specific client IP subnets before traffic ever touches the backend container.
When writing docker-compose.yml files for your backend applications, do not publish ports to host interfaces (avoid ports: - "8080:8080"). Instead, assign the container to proxy-network without port mapping. NPM will communicate with it internally, keeping public access restricted exclusively to ports 80 and 443.
Here are quick solutions to common issues when running Nginx Proxy Manager:
proxy-network. Verify container connection with docker network inspect proxy-network.curl -I http://yourdomain.com.Running Nginx Proxy Manager on a VPS simplifies self-hosting and server management. By pairing Docker Compose with NPM’s visual management interface, you gain absolute control over subdomains, internal container routing, and SSL certificates with minimal maintenance overhead.
Ready to build a complete homelab or server stack? Pair this setup with our guide on cloud storage choices for tech users or check out our comparison on OLED vs IPS vs Mini-LED displays to choose the right workstation gear.