brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: use the Edge Agent when you cannot open a port to the remote machine

Edge
~/tips/tip-portainer-edge-agent

cat ~/tips/tip-portainer-edge-agent.md

Lets Portainer manage a remote Docker host that cannot accept incoming connections.

The normal Portainer Agent wants the server to connect to it. That is awkward for a box behind a home router or someone else’s firewall. The Edge Agent turns it around.

With the Edge Agent, the remote machine connects out to Portainer. The docs say it polls the server for pending jobs, so you open nothing on the remote side. On the Portainer server you need the UI port 9443 and the tunnel port 8000 reachable, which is the tunnel that carries the TLS connection back.

You add one in Environments, then Add environment, then Docker Standalone and Edge Agent Standard. Portainer generates the docker run command for you to paste on the remote host. Do not retype it, because it holds the Edge key.

Two caveats from the docs. With a self-signed certificate the agent only connects when you add -e EDGE_INSECURE_POLL=1. And the default poll is every 5 seconds, which you can change under More settings. The standard Agent on port 9001 is described as the legacy option, so I would start with Edge.

Further reading: Add an Edge Agent environment, Add an Agent environment, On this site: browse and upload files inside a Docker volume from Portainer

More Edge tips Ctrl+Shift+U (Windows) F7 All Edge tips (3) All topics

Link