Install and configure Nginx Proxy Manager Like a Pro

Untitled design1
Untitled

NGINX Proxy Manager

The Nginx Proxy Manager offers a convenient tool for managing proxy hosting. The proxy
manager makes it relatively easy to forward traffic to your services, whether running on the
cloud or your home network.
In this blog, we will understand how to install and configure NGINX proxy manager.

1. Install Docker and Docker-Compose

You can still install Docker on a Linux Server that is not running Ubuntu, however, this may
require different commands

1.1 Install docker

sudo apt update

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt update

sudo apt-get install docker-ce docker-ce-cli containerd.io

(Optional) Install docker via deb file

If you can’t use Docker’s apt repository to install Docker Engine, you can download the deb
file for your release and install it manually. You need to download a new file each time you
want to upgrade the Docker Engine.

First Go to https://download.docker.com/linux/debian/dists/

  1. Select your Debian version in the list.
  2. Go to pool/stable/ and select the applicable architecture (amd64, armhf, arm64,
    or s390x).
  3. Download the following deb files for the Docker Engine, CLI, containerd, and Docker
    Compose packages:
o containerd.io_<version>_<arch>.deb
o docker-ce_<version>_<arch>.deb
o docker-ce-cli_<version>_<arch>.deb
o docker-buildx-plugin_<version>_<arch>.deb
o docker-compose-plugin_<version>_<arch>.deb
  1. Install the .deb packages. Update the paths in the following example to where you
    downloaded the Docker packages.

sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
./docker-ce_<version>_<arch>.deb \
./docker-ce-cli_<version>_<arch>.deb \
./docker-buildx-plugin_<version>_<arch>.deb \
./docker-compose-plugin_<version>_<arch>.deb

The Docker daemon starts automatically.

1.2. Check if Docker is installed correctly

  1. Verify that the Docker Engine installation is successful by running the hello-world
    image:
 sudo service docker start
 sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container
runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.

1.3. Install Docker-Compose

Download the latest version

curl -L
"https://github.com/docker/compose/releases/download/1.25.5/dock
er-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-
compose

This command is used to make the ‘docker-compose’ executable file executable by
changing its file permissions.

sudo chmod +x /usr/local/bin/docker-compose

1.4. Check if Docker-Compose is installed correctly

This command is used to check the version of Docker Compose installed on your system.

sudo docker-compose --version

2. Install and configure Nginx Proxy Manager

  1. First, create a directory for the Nginx Proxy Manager’s Docker Compose files, and change
    into that directory. This tutorial uses the directory ~/nginx-proxy-manager/, and
    the remaining steps assume you are working out of this directory.
mkdir ~/nginx-proxy-manager/
cd ~/nginx-proxy-manager/

2. Create a docker-compose.yml file within the directory:

nano docker-compose.yml

3. Give the file the following contents:

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

When done, press CTRL+X, followed by Y then Enter to save the file and exit nano.

2.2. Start the Nginx Proxy Manager

Start up the Nginx Proxy Manager via Docker Compose:

docker-compose up -d

Login to the web UI of the NGINX proxy manager

Now we can log in to the web UI. Simply use your browser to connect to your server by using
the IP address or an FQDN and connect on port 81.
For example, if you are running the Nginx Proxy Manager on a machine with a public IP
address of 192.0.2.0, you would navigate to 192.0.2.0:81 or Sometimes this can take a
a little bit because of the entropy of keys.
Now we can log in to the web UI. Simply use your browser to connect to your server by using
the IP address or an FQDN and connect on port 81.
For example, if you are running the Nginx Proxy Manager on a machine with a public IP
address of 192.0.2.0, you would navigate to 192.0.2.0:81 .

Sometimes this can take a little bit because of the entropy of keys. Or
http://127.0.0.1:81
Log in with the username [email protected] and the password changeme. Next, you
should change your username and password, and that’s it!

After logging in and updating the credentials for the administrator user, you are directed to the
Nginx Proxy Manager dashboard. You can utilize the proxy manager’s features from this
interface. The next section of the tutorial shows how to get started.

Leave a Reply

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