this post was submitted on 20 Nov 2023
1 points (100.0% liked)

Portainer

28 readers
0 users here now

Portainer Community Edition is a lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments.

founded 1 year ago
MODERATORS
 

Hi all!

I am looking at trying to get NPM - NGINX proxy manager working, and for the life of me cant get it working.

git is installed, and i have tried with #master and without, still no luck, so now i am trying here.

maybe i am going the wrong way here? I just want to add NPM to my container list.

cheers

https://preview.redd.it/m8xh39k3xh1c1.png?width=1155&format=png&auto=webp&s=0bee7104c89d2724f9da23fc280e57fc1351596b

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 11 months ago

I haven’t used git link or anything but my process involved using the image you have. Publishing ports 80,81, 443. And creating directories for data and letsencrypt and mapping those volumes. There are a couple of pretty straightforward videos on YouTube

[–] [email protected] 1 points 11 months ago

I would suggest to use the editor and copy paste the sample code. You need to adjust it to your environment though..

Alternative look for a ready template for portainer stacks..

[–] [email protected] 1 points 11 months ago

You shouldn't need to build the image - the image already exists on Docker Hub. What you want to do is create a container (or stack) that uses the existing image on Docker Hub. Here's a slightly modified version of the stack file from the NPM documentation that you can deploy in Portainer (the only change I've made is to turn the relative path bind mounts into named volumes):

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '443:443'
      - '81:81'

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

volumes:
  data:
  letsencrypt:

In Portainer, go to Stacks, click Add stack, give the stack a name, then paste this into the Web editor and deploy.

Building an image is generally reserved for when you are either creating an image from scratch or are extending an existing image with your own modifications. Simply deploying a container from an image that someone else has created doesn't require any image building.

[–] [email protected] 1 points 11 months ago

here is my stack config for portainer, or otherwise known as docker-compose.yml if you prefer that route. I added notes after # for reminders for myself, maybe they help you.

Portainer -> Stacks -> Add Stack:

Name: nginx-pm

Paste this in web editor:
#####################################################################################

#####################################################################################

##

## Docker Compose File: NGINX Proxy Manager

## Function: Reverse Proxy

##

## Documentation: https://nginxproxymanager.com/setup/#running-the-app

## https://nginxproxymanager.com/

##

## Updating NGINX? Make sure to backup v1/data + v1/letsencrypt from Ubuntu VM,

## then make sure volume mapping reflects v1 data, not v2/v3 as it creates

## new ones every update/redeployment. It's bugged.

#####################################################################################

#####################################################################################

version: '3.8'

services:

app:

container_name: nginx-pm

image: 'jc21/nginx-proxy-manager:latest'

environment:

- PGID=1000 #echo $GID to get this

- PUID=1000 #echo $UID to get this

ports:

- '80:80'

- '81:81'

- '443:443'

volumes:

- /home/YourUSERNAMEHere/data/nginx-pm:/data #host:container mapping

- /home/YourUSERNAMEHere/data/nginx-pm/letsencrypt:/etc/letsencrypt #host:container

logging:

driver: "json-file"

options:

max-file: "10"

max-size: "200k"

restart: unless-stopped