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: add Docker Hub to Portainer's registries with an access token instead of your password

Portainer
~/tips/tip-portainer-dockerhub-token

cat ~/tips/tip-portainer-dockerhub-token.md

Logs Portainer in to Docker Hub so it can pull private images and many images.

Portainer pulls anonymously from Docker Hub by default. That works until you need a private image or pull a lot of them.

In the menu go to Registries, click Add registry and choose DockerHub. Fill in a name and your Docker Hub username. For the secret, use an access token. You create one in Docker Hub under your username menu, Account Settings, on the Security tab. Click Test connection, and when it passes, Add registry.

Test connection has to succeed before the registry can be added, which saves you from a typo that fails later in the middle of a deploy.

An access token is my pick over the account password for a plain reason: you can revoke it without touching the account. The docs name a token, though they do not say why.

Caveat: the docs say Docker Hub is not currently supported as a source for OCI-format Helm charts, so this is about container images.

After that the registry appears in the list when you pick where an image comes from, so a private image becomes a dropdown choice instead of a command you have to remember. You can add other registries the same way, with guides for GitHub, GitLab, Quay and a custom option for the rest.

Further reading: Add a Docker Hub registry, On this site: reset a forgotten Portainer admin password with the helper-reset-password image, On this site: start Portainer with –admin-password-file instead of typing the password in time

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