DEV Community

Cover image for Setup your NGINX proxy manager
Lim Guan Ji
Lim Guan Ji

Posted on

Setup your NGINX proxy manager

Hi Folks,
If you guys are looking to do self hosting and are considering between Traefik and NGINX proxy manager, look no further.
NGINX offers a good user experience to setup your very own self hosting environment.
This guide will teach you how to setup NGINX as your proxy manager.

First step
Installation of docker on your Linux environment.
[Docker Install documentation]

"dockerimage"

(https://docs.docker.com/get-docker/)
Docker-Compose Install documentation

Depending on your OS, your download may vary, Redh8 does not support docker anymore, I would recommend Kali OS as I am using it.
Verify that you have docker and docker-compose installed successfully.

version: '3'
services:
  nginx:
    container_name: nginx
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./config.json:/app/config/production.json
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  db:
    image: 'yobasystems/alpine-mariadb:latest'
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql
Enter fullscreen mode Exit fullscreen mode

Create a docker-compose.yml file in your directory, run docker-compose up -d

"router"

Setup your router to have a Port Forwarding.
In this case, I censored out my IP address and the ports that are exposed, you will require to expose your port to the public. Also get to know what is your public IP from https://whatismyipaddress.com/ and access via your exposed port.

"Beforelogin"

For your first login, please use the below credentials.
You will be prompt to create a user thereafter.
admin@example.com
changeme

"getssl"
Lastly, setup your domain to be signed with an SSL cert

Pls note, you will have to purchase a domain to get an SSL on your website.
Happy self-hosting~

Top comments (0)