Install Nginx Proxy Manager on a Raspberry Pi 4

dbtechdiy, OpenMediaVault, Raspberry Pi, Tutorials, VideoLeave a Comment

Install Nginx Proxy Manager on a Raspberry Pi 4

In this post we’ll look at how to Install Nginx Proxy Manager on a Raspberry Pi 4.

We’re going to use the setup from nginxproxymanager.com, but we’re going to change one thing: the database.

The database that is being used in the docker-compose file on the site isn’t compatible with ARM processors, so we’ll need to change that in a bit.

But first, we need to get logged in to our Raspberry Pi via SSH. This tutorial assumes that you already have Docker and Portainer installed, most likely via OpenMediaVault.

Once you’re logged in via SSH, create a folder called nginx and a new file called config.json in that folder:

mkdir nginx
cd nginx
nano config.json

Then you can paste the following into the terminal screen:

{
  "database": {
    "engine": "mysql",
    "host": "db",
    "name": "DBNAME",
    "user": "DBUSERNAME",
    "password": "DBPASSWORD",
    "port": 3306
  }

Save and close the file.

Now you’ll create a file called docker-compose.yml:

nano docker-compose.yml

Then paste the following in the terminal screen:

---
version: "3"
services:
  app:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginx-proxy-manager
    volumes:
      - ./config.json:/app/config/production.json
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db
    ports:
      - 80:80
      - 443:440
      - 82:81
    restart: unless-stopped
  db:
    image: yobasystems/alpine-mariadb:latest
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ROOTPASSWORD
      MYSQL_DATABASE: DBNAME
      MYSQL_USER: DBUSERNAME
      MYSQL_PASSWORD: DBPASSWORD
    volumes:    
      - /srv/dev-disk-by-label-Files/Config/NGINXDB:/var/lib/mysql
    expose:
      - "3306"

Save and close the file.

Then, to deploy the new container, you can enter the following in your terminal:

sudo docker-compose up -d

Normally we wouldn’t run this as sudo, but there have been incidents where an error comes up about Docker being installed in a non-standard location and running this as sudo seems to get around that.

Once everything has deployed in the terminal screen, you can jump over to Portainer and take a look at the logs for the nginx_app (or similarly named) and make sure that everything has completed.

If the last line of the logs is this:

Creating a new JWT key pair...

Then you need to wait a bit longer for things to finish up.

Once everything has finished, you can go to http://your-server-address:81

The default login credentials are:

Username: [email protected]
Password: changeme

Once you’re logged in, you’ll be prompted to change the username and password.

That’s it! Now you’ve got NGINX Proxy Manager installed on a Raspberry Pi 4!

OpenMediaVault Tutorials

If you’re interested in other tutorials for your home server, check here: https://dbtechreviews.com/category/openmediavault/