Skip to content

A docker-compose stack to get portainer running on your home pc, featuring ddns and https

License

Notifications You must be signed in to change notification settings

raonigabriel/portainer_ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

portainer_ddns

A docker-compose stack to get portainer running on your home pc / cloud vm, featuring ddns and https

Features


Environment variables (change them to your values)

  • CADDY_CERT_EMAIL=me@example.com
  • CADDY_HOSTNAME_PORTAINER=myportainer.ddns.net
  • CADDY_HOSTNAME_SITE=mysite.sytes.net

You need to set those ENV variables on your host. You can add them just for one single command or permanently. I will use the first approach.


Guide

  1. Get yourself a dynamic-dns pointing to your public internet IP address. For this example, I will be using https://www.noip.com as my provider and my custom hostnames will be: myportainer.ddns.net and mysite.sytes.net

Create a new A record for myportainer.ddns.net pointing to your external IP.

Create a new CNAME record for mysite.sytes.net pointing to myportainer.ddns.net

  1. Make sure your home pc is getting assigned a static IP address from your router. The following step depends on this.

For this demo, imagine that your router IP address is 192.168.0.1 and your pc IP address is 192.168.0.2

This is also known as static IP address or IP reservation. This varies depending on the device model and manufacturer, but you can take a look on this guide here

  1. Add 2 port forwarding rules from the external world to you home pc:

[EXTERNAL] 80 -> 192.168.0.2:80

[EXTERNAL] 443 -> 192.168.0.2:443

  1. Make sure you have docker and docker-compose installed

  2. Clone this repo

$ git clone https://github.com/raonigabriel/portainer_ddns.git
  1. Start the stack, passing the variables BEFORE the docker-compose command
$ cd portainer_ddns
$ CADDY_CERT_EMAIL=me@example.com CADDY_HOSTNAME_PORTAINER=myportainer.ddns.net CADDY_HOSTNAME_SITE=mysite.sytes.net docker-compose up -d
  1. Browse to your portainer at https://myportainer.ddns.net or your site at https://mysite.sytes.net