Skip to main content

Setting Up Nginx Reverse Proxy Manager (NPM) on AlmaLinux/Rocky Linux

Updated this week

Introduction

Nginx Proxy Manager (NPM) is a powerful, user-friendly interface for managing reverse proxies using Nginx, making it ideal for self-hosters and system admins seeking simplified SSL management and domain routing. It allows you to host multiple services securely behind a single IP with a clean dashboard and automatic Let's Encrypt support.

Prerequisites

Before proceeding, ensure you have the following:

  • AlmaLinux or Rocky Linux 8 or 9 minimal install.

  • Root or sudo user access.

  • Docker and Docker Compose installed.

  • A domain name pointed to your server’s IP.

  • Firewall ports 80 and 443 open.

  • Basic understanding of CLI and DNS records.

Setup

1. Update System

Start by updating your system's package index to make sure all existing packages are up to date:

sudo dnf update -y && sudo dnf install -y epel-release

2. Install Docker and Docker Compose

AlmaLinux 9 does not come with Docker in the default repository. Therefore, you will need to add the Docker repository to your system and install the Docker engine using the following commands:

sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable --now docker

Install Docker Compose:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Check versions:

Confirm both Docker and Compose are installed correctly.

docker --version
docker-compose --version

3. Create NPM Docker Compose Directory

This is your working directory for storing configuration and persistent data.

mkdir -p ~/npm && cd ~/npm

4. Create docker-compose.yml File

Create a file using your preferred editors such as Nano ar Vim. This configuration defines the NPM app and its MariaDB backend along with necessary credentials and ports.

services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '443:443'
- '81:81'
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
depends_on:
- db
db:
image: 'jc21/mariadb-aria:latest'
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
MARIADB_AUTO_UPGRADE: '1'
volumes:
- ./mysql:/var/lib/mysql

Replace passwords with strong, secure passwords.

5. Start NPM

This command pulls the images and starts NPM and its database in detached mode.

docker compose up -d

6. Access the Web UI

The dashboard gives you full control over proxies, certificates, and user settings.

Open your browser and navigate to http://<your-server-ip>:81

Login using the default credentials:

You'll be prompted to change them immediately.

Now you are ready to create your first proxy! Change credentials and go to “Dashboard” -> “Add Proxy Host”.

Write the domain name, choose scheme on which your current web application is working, server’s IP address and it’s port. Check “Block Common Exploits” and set it for SSL certificate to be issued. Be aware, your domain needs to be pointed to your server’s IP address!

Conclusion

Setting up Nginx Proxy Manager on AlmaLinux or Rocky Linux gives you an efficient and secure way to manage your self-hosted applications behind a modern reverse proxy with minimal complexity. With Docker handling the service, updates and maintenance are straightforward, while the web UI makes SSL and domain routing easier than ever. This setup is highly scalable — perfect for homelabs, production apps, or anything in between.

Did this answer your question?