Search
Close this search box.

How to Install and Secure Nginx Proxy Manager on Debian 12

Table of Contents

Managing web traffic efficiently is crucial for any server administrator, and Nginx Proxy Manager provides a powerful and user-friendly solution for this task. Whether you’re handling multiple domains or just a single website, Nginx Proxy Manager simplifies the process of managing proxy hosts, SSL certificates, and more, all through an intuitive web interface. In this comprehensive guide, we’ll walk you through the step-by-step process of installing Nginx Proxy Manager on Debian 12, ensuring you can harness its full potential to streamline your web traffic management. By the end of this tutorial, you’ll have a fully functional Nginx Proxy Manager setup, ready to handle all your proxy needs with ease.

 

To begin, ensure you’ve established a VPSie Account if you haven’t yet. Then, move forward by deploying the Debian 12 server tailored to meet your exact requirements. 

Once the server is deployed, SSH into the command line interface. Before installing any packages, it’s essential to update your system’s package list to ensure you have access to the latest versions. Open a terminal and run the following command:

sudo apt update && sudo apt upgrade -y

Install Docker

First, install necessary packages to allow apt to use a repository over HTTPS:

 

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
 
Set up the stable repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
 
Update the package index and install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
 
Start and enable Docker:
sudo systemctl start docker
sudo systemctl enable docker
 

Install Docker Compose

Download the current stable release of Docker Compose:

sudo curl -L "https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose

 

Verify the installation:

docker-compose --version

Set up Nginx Proxy Manager

Create a directory for Nginx Proxy Manager:

mkdir -p ~/nginx-proxy-manager
cd ~/nginx-proxy-manager
 
Create a docker-compose.yml file:
nano docker-compose.yml

 

 

Add the following content to the docker-compose.yml file:

				
					version: '3'

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

  db:
    image: 'mariadb:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/MySQL
				
			

Start nginx proxy manager by deploying the stack:

 

docker-compose up -d
 

Access the Nginx Proxy Manager

Open your web browser and navigate to http://<your_server_ip>:81. You will be presented with the Nginx Proxy Manager login screen.

 

 

Log in using the default credentials:

 

 
After logging in, you will be prompted to change your email and password.

Everything is now set up, and you will be presented with the Dashboard, ready to start managing your proxies.

Set up Domain name and SSL for Nginx Proxy Manager

To set up a domain name and SSL for Nginx Proxy Manager, you’ll need to follow these steps:

 

1. Update DNS Records

 

Update the DNS records for your domain eg, npm.menon.fun to point to your Debian server’s IP address.

 

2. Configure Nginx Proxy Manager

 

  • Click on “Hosts” then “Proxy Hosts” in the sidebar.
  • Click on the “Add Proxy Host” button.

 

Fill in the following details:

 

  • Domain Names: Enter your domain name, e.g., npm.menon.fun.
  • Scheme: Select http://.
  • Forward Hostname/IP: Enter the IP address your Debian server.
  • Forward Port: Enter the port of the service you want to proxy (e.g., 81).

Switch to the SSL tab:

 

 

  • Now, Select “Request a new SSL Certificate” if you want Nginx Proxy Manager to handle SSL certificate generation.
  • Enable Force SSL and HTTP/2 support
 

Please enter your email address and agree to the Let’s Encrypt Terms of Service (TOS). Once done, click the “Save” button to complete the process.

.

After configuring the SSL certificate, you should verify that SSL is working correctly:

 

  • Visit your domain in a web browser using https://npm.menon.fun.
  • You should see the lock icon indicating that the connection is secure.
 



You’ve turned your Debian server into a traffic-routing powerhouse with Nginx Proxy Manager. By setting up your domain and SSL, you’ve not only secured your connections but also made your services accessible under a memorable address. Now, sit back, relax, and let Nginx Proxy Manager handle the heavy lifting of directing traffic to where it needs to go.

Make a Comment
Share on
Facebook
Twitter
LinkedIn
Print
VPSie Cloud service

Fast and Secure Cloud VPS Service

Try FREE
For a month

The First 1 orders gets free discount today! Try Sign up on VPSie to get a chance to get the discount.