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: switch on Force HTTPS only in Portainer, but test 9443 first

Access and security
~/tips/tip-portainer-force-https

docker run -d ... portainer/portainer-ce:lts --http-disabled

Turns off Portainer's plain HTTP port so the web UI is only served over HTTPS.

Portainer listens on both HTTP and HTTPS out of the box. If you only use HTTPS, you can close the plain one.

In Settings under SSL certificate, turn on Force HTTPS only. It disables the listener on port 9000 when Portainer is on 9443. The command-line way is --http-disabled, which overrides --http-enabled.

docker run -d ... portainer/portainer-ce:lts --http-disabled

The caveats are written right next to the setting. Verify that HTTPS works first, or you lock yourself out of the web UI. The docs also say agents and Edge Agents must talk to Portainer over HTTPS before you force it. The setting does not affect standard Agent deployments.

There is a sibling, Force Secure cookies, that sets the Secure attribute on login cookies. It breaks login over plain HTTP, which is the point.

I would use this setting on anything that is reachable from outside the house.

If you reach Portainer through a reverse proxy, check how the proxy talks to it first. A proxy that still points to port 9000 stops working the moment you turn HTTP off. Change the target to HTTPS on 9443, test it, and only then flip the setting.

Further reading: General settings, CLI configuration, On this site: start Portainer with –admin-password-file instead of typing the password in time, On this site: give containers made outside Portainer an owner with an access-control label

Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get

More Access and security tips sha256sum -c --ignore-missing SHA256SUMS lastlog --before 90 certbot renew --dry-run certbot certificates mkcert -install All Access and security tips (119) All topics

Link