Nginx Proxy Manager is a powerful tool for managing web proxies. It can act as a reverse proxy to forward requests to your internal web services. In other words, you can host multiple websites with just 1 IP. Compared to Traefik and Nginx, Nginx Proxy Manager provides an intuitive GUI to create your own rules. This article will teach you how to install Nginx Proxy Manager using Docker Compose on Ubuntu 22.04.
Step 1: Update the package list and install the required packages
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
Step 2: Import Docker official GPG Key to your system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 3: Update the package list again and install Docker Compose
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
Step 4: Create a folder called nginx in your home directory
cd ~
mkdir nginx
Step 5: Move to your Nginx Proxy Manager folder and create a docker-compose.yml
cd nginx
sudo nano docker-compose.yml
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
networks:
- npm
networks:
npm:
name: npm_network
Press Ctrl + X to save the file.
Step 6: Execute the container in the background
sudo docker compose up -d
Step 7: Log in to the Admin interface.
Replace your_ip with your IP. http://your_ip:81/
The default user and password are:
Email: [email protected]
Password: changeme
You have to change the admin email and password after the first login. Congratulation, you have installed Nginx Proxy Manager successfully.
In the following article, you will learn how to combine Nginx Proxy Manager with Cloudflare to reverse proxy your internal web services.