Nginx Proxy Manager Installation and Usage Guide
Nginx Proxy Manager (NPM) is a web-based interface for managing Nginx reverse proxy configurations. It simplifies setting up proxy hosts, SSL certificates, and access controls using an intuitive dashboard.
Prerequisites
[] A server running Linux (Ubuntu, Debian, or any Docker-compatible OS)
[] Docker and Docker Compose installed
[] A domain name (optional, but recommended for SSL setup)
[] Access to ports 80 and 443 (for web traffic)
Installation
1. Install Docker and Docker Compose
Ensure that Docker and Docker Compose are installed on your system:
sudo apt update
sudo apt install docker.io -y
sudo apt install docker-compose -y
2. Create a Directory for Nginx Proxy Manager
mkdir -p ~/nginx-proxy-manager && cd ~/nginx-proxy-manager
3. Create a docker-compose.yml File
Create and edit the file:
nano docker-compose.yml
Paste the following content:
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80' # HTTP
- '81:81' # Admin Panel
- '443:443' # HTTPS
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
environment:
DB_SQLITE_FILE: "/data/database.sqlite"
4. Start the Container
docker-compose up -d
5. Access the Web UI
Using Nginx Proxy Manager
Adding a Proxy Host
[] Navigate to Hosts > Proxy Hosts
[] Click Add Proxy Host
[] Enter the domain/subdomain in the Domain Names field
[] Set the Forward Hostname/IP and Forward Port (e.g., 192.168.1.100, port 8080 for an internal service)
[] Select Access List (optional, for access restrictions)
[] Toggle Block Common Exploits for security
-
Click Save
Enabling SSL Certificates
[] Edit the proxy host
[] Go to the SSL tab
[] Select Request a new SSL Certificate
[] Enable Force SSL (redirects HTTP to HTTPS)
-
Agree to Let’s Encrypt Terms and click Save
Access Lists
Redirection Hosts
Streams
Advanced Settings
[] Custom Nginx Configurations: Add custom rules (e.g., rate limiting, caching, etc.).
[] Access Logs: Monitor traffic to your services.
-
Error Logs: Debugging failed requests.
Updating Nginx Proxy Manager
cd ~/nginx-proxy-manager
docker-compose pull
docker-compose up -d
Troubleshooting
[] Cannot access the web UI? Ensure port 81 is open.
[] SSL issues? Check if ports 80 and 443 are properly forwarded.
-
Container won’t start? Check logs with:
docker logs <container_id>
Conclusion
Nginx Proxy Manager simplifies reverse proxy configurations with an intuitive UI. It provides easy SSL setup, access control, and monitoring tools, making it ideal for home labs and production environments.