Site Overlay

Install Nginx Proxy Manager (NPM) – Proxmox Container


Environment:

Proxmox Version: 6.3

Container/CT Template: Debian 10 Standard

RAM: 4G

Cores: 2

Disk Size: 30G


Sebelum memulai pastikan sudah membuat container dan menginstall docker serta docker-compose yang bisa dilihat di Install dan Konfigurasi Docker di Linux Container (LXC) Proxmox. Selanjutnya ikuti langkah berikut ini:

1. Membuat Folder NPM

mkdir /srv/npm
cd /srv/npm

2. Buat File Docker Compose

nano docker-compose.yaml
version: "3"
services:
  app:
    image: jc21/nginx-proxy-manager:latest
    restart: always
    ports:
      # Public HTTP Port:
      - '80:80'
      # Public HTTPS Port:
      - '443:443'
      # Admin Web Port:
      - '81:81'
    #environment:
      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      # Make sure this config.json file exists as per instructions above:
      - ./config.json:/app/config/production.json
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db
  db:
    image: jc21/mariadb-aria:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql

3. Buat File Config NPM

nano config.json
{
  "database": {
    "engine": "mysql",
    "host": "db",
    "name": "npm",
    "user": "npm",
    "password": "npm",
    "port": 3306
  }
}

4. Jalankan Docker-Compose

docker-compose up -d

Perintah itu akan otomatis membaca file docker-compose.yaml dan membuat 2 docker container dengan nama npm_app_1 dan npm_db_1. Setelah proses selesai, lihat hasilnya dengan perintah,

root@npm:/srv/npm# docker ps -a
CONTAINER ID   IMAGE                             COMMAND             CREATED          STATUS                    PORTS                                            NAMES
b4aaa56a4225   jc21/nginx-proxy-manager:latest   "/init"             46 minutes ago   Up 45 minutes (healthy)   0.0.0.0:80-81->80-81/tcp, 0.0.0.0:443->443/tcp   npm_app_1
5b77403ca903   jc21/mariadb-aria:latest          "/scripts/run.sh"   46 minutes ago   Up 46 minutes             3306/tcp                                         npm_db_1
root@npm:/srv/npm# 

Nginx Proxy Manager sudah bisa diakses via browser dengan url http://ip_container_proxmox:81 dengan username admin@example.com dan password changeme.

Note:

Jika saat login muncul error Bad Gateway, pastikan kedua container tadi statusnya Up. Jika statusnya Up (Unhealty), lihat lognya dan periksa apakah ada langkah / scipt code yang terlewatkan. Status Unhealty pada npm_app_1 bisa jadi karena file config.json ( langkah ke-3 ) terlewati.

Done…

Leave a Reply

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

Scroll Up