Introduction
Nginx Proxy Manager is a powerful tool that enables developers and homelabbers to manage and route incoming traffic to various services hosted on a VPS. This guide will walk you through the process of setting up Nginx Proxy Manager on a VPS, complete with SSL configuration for enhanced security.
Prerequisites
Before diving into the installation, ensure that you have:
-
A VPS with a public static IP address. Recommended providers include:
Provider Monthly Price Contabo VPS 5.99 EUR/mo Hetzner Cloud 4.15 EUR/mo DigitalOcean 6 USD/mo Vultr 6 USD/mo Linode (Akamai) 5 USD/mo -
A domain name pointed to your VPS IP address.
-
Basic knowledge of Docker and Docker Compose.
Step 1: Choosing Your VPS Provider
Select a VPS provider that aligns with your budget and performance needs. For developers and homelabbers, the Hetzner Cloud VPS at 4.15 EUR/mo is a popular choice due to its balance of affordability and performance. You can sign up and get started here.
Step 2: Install Docker and Docker Compose
-
Update your VPS
sudo apt update && sudo apt upgrade -y -
Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh -
Add your user to the Docker group
sudo usermod -aG docker $USERLog out and back in to apply group changes.
-
Install Docker Compose
sudo apt install -y docker-compose
Step 3: Set Up Nginx Proxy Manager
-
Create a directory for Nginx Proxy Manager
mkdir ~/nginx-proxy-manager cd ~/nginx-proxy-manager -
Create a
docker-compose.ymlfileUse your favorite text editor to create the file:
version: '3' services: app: image: jc21/nginx-proxy-manager container_name: npm environment: DB_SQLITE_FILE: "/data/database.sqlite" volumes: - npm_data:/data ports: - "80:80" - "443:443" restart: unless-stopped volumes: npm_data: -
Start the Nginx Proxy Manager
docker-compose up -d
Step 4: Accessing Nginx Proxy Manager
Once Nginx Proxy Manager is up and running, you can access it via your browser using your domain name:
- Default login credentials:
- Email: [email protected]
- Password: changeme
Change these credentials upon first login for security reasons.
Step 5: Configure SSL with Letโs Encrypt
To secure your connections using SSL, follow these steps:
-
Open the Nginx Proxy Manager interface.
-
Add a new proxy host:
- Go to โProxy Hostsโ and click โAdd Proxy Host.โ
- Fill in the domain name.
- Specify the IP address of the service you want to route traffic to.
-
Enable SSL:
- Check the โBlock Common Exploitsโ option.
- Enable โSSLโ and select โRequest a new SSL certificate.โ
- Agree to the Letโs Encrypt Terms of Service.
-
Save and test your configuration.
FAQs
How does Nginx Proxy Manager simplify network traffic management?
Nginx Proxy Manager provides a user-friendly web interface for managing proxies without needing extensive command-line knowledge. This tool allows you to effortlessly redirect traffic, manage SSL certificates, and control access to various services. The graphical dashboard significantly reduces operational complexity for developers and homelabbers, enabling them to concentrate on application development rather than network configuration.
Can I use Nginx Proxy Manager with multiple services?
Yes, Nginx Proxy Manager excels at managing multiple services running on different ports or even on different VPS instances. You can create numerous proxy hosts, each directing traffic to a specified service based on the configured domain or subdomain. This capability makes it an excellent choice for hosting various applications on the same VPS, maintaining order and accessibility.
What should I do if I encounter issues with SSL certificates?
If you encounter issues while requesting SSL certificates through Nginx Proxy Manager, first ensure that your domain name is correctly pointed to your VPS and that there are no firewall rules blocking HTTP/HTTPS traffic. You can manually verify your domainโs DNS settings using tools like DNSChecker. If problems persist, consider following troubleshooting steps available on forums like r/selfhosted or exploring documentation from Nginx Proxy Manager itself.
Conclusion
Setting up Nginx Proxy Manager on your VPS is a straightforward process that can greatly simplify the management of your self-hosted applications. By following the steps outlined in this guide, you can establish a secure environment that allows for efficient traffic routing to your various services. For a full VPS comparison, check out our VPS comparison page.