• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Solutions Docker

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

by neo
June 8, 2025
in Docker
0
Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

0
SHARES
0
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Introduction

Managing reverse proxies, SSL certificates, and domain redirections can get complicated fast. Nginx Proxy Manager (NPM) makes it easy by providing a clean web interface on top of Nginx. This guide walks you through install Nginx Proxy Manager on a Raspberry Pi 4 running Ubuntu 22.04, using Docker and Docker Compose. You’ll be up and running in minutes.

If you’re looking to install Nginx Proxy Manager with Docker on a Raspberry Pi 4, this step-by-step guide covers everything you need.

Prerequisites

Make sure you have the following:

ADVERTISEMENT
  • Raspberry Pi 4 with Ubuntu Server 22.04 (64-bit) installed
  • Internet connection
  • Docker and Docker Compose installed
  • Basic terminal experience

If Docker is not yet installed, you can check my post about it.

Steps to Install Nginx Proxy Manager with Docker on Pi4

1. Create Project Directory for Nginx Proxy Manager on Your Pi4

mkdir -p ~/nginx-proxy-manager
cd ~/nginx-proxy-manager

2. Create Docker Compose File

Create a docker-compose.yml file:


services:
  proxy:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginx-proxy-manager
    restart: unless-stopped
    ports:
      - "80:80"
      - "81:81"
      - "443:443"
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "${MYSQL_USER}"
      DB_MYSQL_PASSWORD: "${MYSQL_PASSWORD}"
      DB_MYSQL_NAME: "${MYSQL_DATABASE}"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db
    networks:
      - npm_network

  db:
    image: mariadb:10.5
    container_name: npm-mariadb
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
      MYSQL_DATABASE: "${MYSQL_DATABASE}"
      MYSQL_USER: "${MYSQL_USER}"
      MYSQL_PASSWORD: "${MYSQL_PASSWORD}"
    volumes:
      - ./mysql:/var/lib/mysql
    networks:
      - npm_network

networks:
  npm_network:
    driver: bridge

3. Create the Environment File

Create a file named .env in the same folder as your docker-compose.yml:

# Root password for the MariaDB server (used only internally)
MYSQL_ROOT_PASSWORD=strong-root-password

# Database name and user credentials for Nginx Proxy Manager
MYSQL_DATABASE=npm
MYSQL_USER=npm
MYSQL_PASSWORD=secure-password

Tip: Always use strong passwords and never commit this file to version control (e.g., GitHub).

3.1 (Optional) Load Environment Variables

If your environment file is not named .env (e.g., it’s called docker-compose.env), you must load the variables manually before starting the containers:

set -a && source ./docker-compose.env && set +a

This command temporarily exports all environment variables from your docker-compose.env file into the shell session.
It ensures that Docker Compose can substitute them correctly in your docker-compose.yml.

4. Start the Containers

Now, start Nginx Proxy Manager with:

docker compose up -d

Check the running containers:

docker ps

You should see two containers running: nginx-proxy-manager and npm-mariadb.

5. Access the Nginx Proxy Manager Web Interface

Open your browser and go to:

ADVERTISEMENT
http://<RaspberryPi-IP>:81

Login with the default credentials:

  • Email: admin@example.com
  • Password: changeme

You’ll be prompted to change them on first login.

Conclusion

You’ve successfully installed Nginx Proxy Manager on your Raspberry Pi 4 running Ubuntu 22.04, using Docker and Docker Compose. With a user-friendly web interface, managing reverse proxies, SSL certificates, and domain forwarding becomes fast and simple.

ADVERTISEMENT

Now you can start adding your services and securing them with Let’s Encrypt SSL certificates with just a few clicks.

In upcoming blog posts, I will show you how I installed Nextcloud and WordPress on the same Raspberry Pi 4, and how I configured Nginx Proxy Manager to securely expose those services to the internet using custom domains and HTTPS.

Stay tuned for more Raspberry Pi self-hosting tutorials!

About The Author

neo

See author's posts

Tags: docker
ADVERTISEMENT
Previous Post

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

neo

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Recent News

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.