Skip to content

Authenticate Podman to GitHub Container Registry


Sometimes you want to push or pull container images from GitHub's container registry


Create a personal access token in GitHub and give it access to:

read:packages if you are only pulling images, but if you plan to push and delete then add write:packages and delete:packages

Export it as an environment variable


Podman login

echo $GHCR_TOKEN | podman login -u <gh username> --password-stdin

I had an issue where this did not seem to work, so I had to take manual steps

Doing it our selves

Prepare the token and your username like the below


An example would be


base64 encode this

echo "userbradley:ghp_sDo2TpI6ONLUYGJH34KPWAq7QIfL0SInIe" | base64

Insert the output in to the config file

Edit ~/.config/containers/auth.json

  "auths": {
    "": {
      "auth": "dXNlcmJyYWRsZXk6YnJvX3N0b3BfaXQK"
    "": {
      "auth": "dXNlcmJyYWRsZXk6Z2hwX1N0b3BUcnlpbmdUb0ZpbmRNeUNyZWRlbnRpYWxzSG9taWUK"

Now you should be able to access ghcr repos

Want to make this site better? Open a PR or help fund hosting costs