I would also like to thank you for rolling this thread out. I got useful hints, and stayed for three nights with testing.
It’s actually pretty easy.
But first I must say, that my goal was to get portainer and nginx proxy manager running on my vps. I wanted nginx proxy manager to manage certificates, etc.
That wasn’t working in any way.
The good news is, you can use portainer and install any other docker apps, but you don’t need (cannot use) the nginx proxy manager. Instead, you can (you must) use yunohost.
1
So, at first you have to install docker for debian. Just follow the official guides.
Get the apt-key for the docker repository, add the repository, update apt and then install docker.
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
apt update
apt install docker-ce docker-ce-cli containerd.io
It seems portainer has docker-compose inside. But it’s no problem, and a good idea anyway to install the newest version on your host, seperatly.
apt install docker-compose
2
So, you got docker, and now it’s time to install portainer.
At first create a volume for portainer
docker volume create portainer_data
Then run and install the community edition
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Next step is to set-up portainer with your credentials. Call your server with the IP address over port 9000.
http://1.2.3.4:9000
3
To reach portainer, or later other docker apps on your server over a FQDN or sub domain, you must add a DNS entry.
Go to your registrar and add an A-Record or CNAME for portainer.example.org that hints the IP of your server.
On yunohost, add this domain or subdomain to the list of managed names.
4
Then install the younohost app → redirect
You can install the app several times. Any other instance needs this app again!
In this example you will setup the app for
portainer.example.org
Label for Redirect: just give it a name
Redirect-portainer
Choose the (sub-)domain for your app instance
portainer.example.org
Choose the path for this app (leave empty)
/
Redirect destination path
(YOU NEED THE docker portainer → any INSTANCE IP OF THE CONTAINER AND THE PORT to point at), for example:
http://172.18.0.1:9000/
For nginx proxy manager it would have been http://172.19.0.4:81 // just an example // not important anymore.
VERY IMPORTANT IS THE
Redirect type
CHOOSE
Proxy, invisible (nginx proxy_pass). Everybody will be able to access it.
Then click install to get the yunohost redirect app running.
5
Go back to yunohost domains and request a Let’s encrypt certificate for the sub-domain where the docker-app (portainer) runs.
Finally call your project at portainer.example.org
Repeat this for other docker-apps in portainer on your yunohost.