{"id":126,"date":"2021-03-11T13:52:31","date_gmt":"2021-03-11T05:52:31","guid":{"rendered":"https:\/\/blog.wikazo.com\/?p=126"},"modified":"2021-03-12T08:58:28","modified_gmt":"2021-03-12T00:58:28","slug":"install-nginx-proxy-manager-npm-proxmox-container","status":"publish","type":"post","link":"https:\/\/blog.wikazo.com\/index.php\/2021\/03\/11\/install-nginx-proxy-manager-npm-proxmox-container\/","title":{"rendered":"Install Nginx Proxy Manager (NPM) &#8211; Proxmox Container"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-text-color has-background is-style-wide\" style=\"background-color:#04a53f;color:#04a53f\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Proxmox Version: 6.3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Container\/CT Template: Debian 10 Standard<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">RAM: 4G<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cores: 2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Disk Size: 30G<\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-background is-style-wide\" style=\"background-color:#04a53f;color:#04a53f\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Sebelum memulai pastikan sudah membuat container dan menginstall docker serta docker-compose yang bisa dilihat di <strong>Install dan Konfigurasi Docker di Linux Container (LXC) Proxmox<\/strong>. Selanjutnya ikuti langkah berikut ini:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Membuat Folder NPM<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">mkdir \/srv\/npm\ncd \/srv\/npm<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Buat File Docker Compose<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">nano docker-compose.yaml<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">version: &quot;3&quot;\nservices:\n  app:\n    image: jc21\/nginx-proxy-manager:latest\n    restart: always\n    ports:\n      # Public HTTP Port:\n      - '80:80'\n      # Public HTTPS Port:\n      - '443:443'\n      # Admin Web Port:\n      - '81:81'\n    #environment:\n      # Uncomment this if IPv6 is not enabled on your host\n      # DISABLE_IPV6: 'true'\n    volumes:\n      # Make sure this config.json file exists as per instructions above:\n      - .\/config.json:\/app\/config\/production.json\n      - .\/data:\/data\n      - .\/letsencrypt:\/etc\/letsencrypt\n    depends_on:\n      - db\n  db:\n    image: jc21\/mariadb-aria:latest\n    restart: always\n    environment:\n      MYSQL_ROOT_PASSWORD: 'npm'\n      MYSQL_DATABASE: 'npm'\n      MYSQL_USER: 'npm'\n      MYSQL_PASSWORD: 'npm'\n    volumes:\n      - .\/data\/mysql:\/var\/lib\/mysql<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Buat File Config NPM<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">nano config.json<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;fileName&quot;:&quot;4Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">{\n  &quot;database&quot;: {\n    &quot;engine&quot;: &quot;mysql&quot;,\n    &quot;host&quot;: &quot;db&quot;,\n    &quot;name&quot;: &quot;npm&quot;,\n    &quot;user&quot;: &quot;npm&quot;,\n    &quot;password&quot;: &quot;npm&quot;,\n    &quot;port&quot;: 3306\n  }\n}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Jalankan Docker-Compose<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">docker-compose up -d<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Perintah itu akan otomatis membaca file <strong>docker-compose.yaml <\/strong>dan membuat 2 docker container dengan nama <strong>npm_app_1<\/strong> dan <strong>npm_db_1<\/strong>. Setelah proses selesai, lihat hasilnya dengan perintah,<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@npm:\/srv\/npm# docker ps -a\nCONTAINER ID   IMAGE                             COMMAND             CREATED          STATUS                    PORTS                                            NAMES\nb4aaa56a4225   jc21\/nginx-proxy-manager:latest   &quot;\/init&quot;             46 minutes ago   Up 45 minutes (healthy)   0.0.0.0:80-81-&gt;80-81\/tcp, 0.0.0.0:443-&gt;443\/tcp   npm_app_1\n5b77403ca903   jc21\/mariadb-aria:latest          &quot;\/scripts\/run.sh&quot;   46 minutes ago   Up 46 minutes             3306\/tcp                                         npm_db_1\nroot@npm:\/srv\/npm# <\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Nginx Proxy Manager sudah bisa diakses via browser dengan url <strong>http:\/\/ip_container_proxmox:81 <\/strong>dengan username <strong>admin@example.com<\/strong> dan password <strong>changeme<\/strong>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Jika saat login muncul error <strong>Bad Gateway<\/strong>, pastikan kedua container tadi statusnya <strong>Up<\/strong>. Jika statusnya <strong>Up (Unhealty)<\/strong>, 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Done&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<span class=\"more-button\"><a href=\"https:\/\/blog.wikazo.com\/index.php\/2021\/03\/11\/install-nginx-proxy-manager-npm-proxmox-container\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Install Nginx Proxy Manager (NPM) &#8211; Proxmox Container<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[19,7,9,20,22,8,21],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-notes","tag-debian","tag-docker","tag-linux","tag-nginx","tag-npm","tag-proxmox","tag-proxy"],"_links":{"self":[{"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":6,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":141,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions\/141"}],"wp:attachment":[{"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wikazo.com\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}