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: fill in Public IP on a Portainer environment so the port links go somewhere useful

Portainer
~/tips/tip-portainer-environment-public-ip

Public IP: 192.168.1.20

Makes the published port links in Portainer open the real address of your Docker host.

Portainer shows the published ports of a container as links you can click, which is handy right up until the link opens an address your browser can’t reach. That little annoyance has a fix in a field most people scroll past.

Every environment in Portainer has a Public IP field. The docs describe it as the URL or address where exposed containers will be reachable, and when it is empty Portainer falls back to the environment URL. That’s fine for an agent at a real address. It’s less fine when the environment is the local Docker socket, because a socket path is not something your browser can open.

To set it, go to Environment-related, then Environments, click the name of the environment and fill in the field:

Public IP: 192.168.1.20

Use the LAN address of the Docker host, or a host name that resolves to it, and save. A container that publishes 8096, like Jellyfin does by default, now gets a link to 192.168.1.20:8096 instead of a dead tab.

The caveat is that this field only changes the links. It doesn’t publish a port or touch Docker at all. If the address of your server changes, the links quietly go stale, so I’d give the host a fixed address or a DHCP reservation in the router before I typed it in here. And if you reach your apps through a reverse proxy with nice host names, the links still point at IP and port, because Portainer has no idea about your proxy hosts.

Further reading: Portainer docs: Environments

More Portainer tips Choose Polling in a Portainer GitOps update when your Git host can't reach Portainer Put Portainer environments in groups and give users access to a whole group Portainer's Edge Agent checks in every 5 seconds, and you can change that docker run -d -p 9001:9001 --name portainer_agent --restart=always \ Deploy the container → Replace All Portainer tips (28) All topics

Link