This is a way to setup Portainer & Nginx Proxy Manager to manage your server.
-
Create the volumes to persist data.
docker volume create proxy_data docker volume create proxy_letsencrypt docker volume create portainer_data
-
Create the network for the proxied containers.
docker network create proxy
Reuse this in portainer later if you need to expose containers.
-
Deploy the compose file & open port 81 for Nginx Proxy Manager.
# Adjust the time zone in the compose file. # Uncomment the port mapping for port 81 in the compose file. docker compose up -d
-
Point your domain for the proxy to the server.
-
Setup a proxy host for Nginx Proxy Manager to proxy it's own admin interface.
proxy.your-domain.tld->http://localhost:81Request a Let's Encrypt certificate and force ssl.
-
Close the port 81 and change your Nginx Proxy Manager password.
docker compose down # Comment/remove the port mapping for port 81 in the compose file and recreate the containers. docker compose up -d -
Continue using
proxy.your-domain.tldwith ssl for accessing Nginx Proxy Manager. -
Setup your portainer domain.
-
Setup the proxy host for portainer.
portainer.your-domain.tld->https://portainer:9443Request a Let's Encrypt certificate and force ssl.
-
Verify force ssl is enabled for both domains, since it sometimes switches of when requesting a certificate.
Make sure your using IPv4 so that Nginx Proxy Manager can verify domain ownership for Let's Encrypt going through the docker network.