Introduction

Nginx Proxy Manager (NPM) is a powerful tool that simplifies the management of reverse proxies, SSL certificates, and domain routing through an intuitive web interface. It is especially useful for self-hosted applications and managing multiple web services securely.

Docker provides an efficient way to deploy Nginx Proxy Manager, making it easy to install, update, and manage without conflicts or dependency issues.

Prerequisites

Before proceeding, ensure that:

  • You have Ubuntu 24.04 LTS installed on your server.
  • Docker and Docker Compose are installed.
  • You are using a non-root user with sudo privileges.

Step 1: Install Docker and Docker Compose

If Docker is not installed, set it up using the following commands:

sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io docker-compose
sudo systemctl enable --now docker

Verify Docker is running:

sudo docker --version
sudo docker-compose --version

Step 2: Create a Directory for Nginx Proxy Manager

To store configuration files, create a directory:

sudo mkdir -p /opt/npm
sudo chown -R $USER:$USER /opt/npm
cd /opt/npm

Step 3: Create the Docker-Compose File

Create and edit the docker-compose.yml file:

sudo nano /opt/npm/docker-compose.yml

Paste the following configuration:

version: '3'
services:
  npm:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: npm
    restart: always
    ports:
      - "80:80"      # HTTP
      - "443:443"    # HTTPS
      - "81:81"      # Admin Panel
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    environment:
      - DB_SQLITE_FILE=/data/database.sqlite

Save and exit (Ctrl + X, then Y, then Enter).

Step 4: Start Nginx Proxy Manager

Run the following command to launch NPM:

cd /opt/npm
sudo docker-compose up -d

Check if the container is running:

sudo docker ps

Step 5: Access Nginx Proxy Manager Web UI

Once the container is running, open your browser and visit:

http://your-server-ip:81

Default Login Credentials:

Email: [email protected]
Password: changeme

After logging in, update your credentials.

Step 6: Add a Proxy Host

  1. Go to Proxy Hosts in the dashboard.
  2. Click Add Proxy Host.
  3. Enter the domain/subdomain you want to use.
  4. Scheme: http
  5. Forward Hostname/IP: your_vps_ip or 127.0.0.1
  6. Forward Port: 81
  7. Enable Block Common Exploits for security.
  8. Enable SSL:
    • Select “Request a new SSL Certificate.” (Recommended Force SSL and HTTP/2 Support
    • Agree to the Terms of Service.
  9. Click Save.
  10. if you create sub-domain or point ip you may have to wait for 24 hours or depending on domain propagation

Conclusion

Nginx Proxy Manager is now successfully installed and running on your Ubuntu 24.04 server. You can manage your web applications efficiently with SSL, reverse proxy, and domain-based routing—all from an easy-to-use interface.

About EngineerHow

EngineerHow.com is your go-to platform for tutorials on self-hosting, IT infrastructure, and engineering solutions. Stay tuned for more guides and tutorials!