1. Home
  2. Docs
  3. Self-hosted Server
  4. Nginx Proxy Manager: Reve...
  5. Cara Install Nginx Proxy Manager di Docker Container

Cara Install Nginx Proxy Manager di Docker Container

Contoh cara install atau deploy server reverse proxy dengan nginx proxy manager di docker container.

Deploy Nginx Proxy Manager

Buat file docker-compose.yml :

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginxproxymanager
    restart: unless-stopped
    ports:
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Tambahkan jika kalian ingin expose Stream port
      # - '21:21' # FTP

    # environment:
      # Uncomment jika kalian ingin merubah lokasi
      # file DB SQLite nya
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment jika ingin disable IPV6
      # DISABLE_IPV6: 'true'

    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

Ini adalah konfigurasi dasar menggunakan database SQLite yang diperlukan untuk deploy app nginx proxy manager di docker container.

Kemudian :

docker compose up -d

Deploy Menggunakan Database MySQL / MariaDB

Jika ingin menggunakan database MySQL / MariaDB, ini contoh docker-compose.yml nya :

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginxproxymanager
    restart: unless-stopped
    ports:
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Tambahkan jika kalian ingin expose Stream port
      # - '21:21' # FTP
    environment:
      # Mysql/Maria connection parameters:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
      # Uncomment jika ingin disable IPV6
      # DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db

  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
      MARIADB_AUTO_UPGRADE: '1'
    volumes:
      - ./mysql:/var/lib/mysql

Login ke Admin UI

Setelah container sudah running, akses menggunakan port 81 untuk interface adminnya.

Default Username Password Admin Nginx Proxy Manager

Email:    [email protected]
Password: changeme

Setelah berhasil login kalian akan langsung di minta untuk merubah default username & password.

Tags

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *