Recommended setup to handle Docker login credentials securely on Ubuntu Server.
- π§ Ubuntu Server 25.10 or newer
- Docker installed
- Brew installed
- Clear any previous docker logins:
docker logout
docker logout ghcr.io- Install required dependencies:
sudo apt install -y pass gnupg2
brew install docker-credenetial-helper- Generate GPG key
gpg --generate-key- Retrieve the key ID
gpg --list-secret-keys --keyid-format LONGImportant
In
sec ed25519/AB12CD34EF56GH78 2026-03-26 [SC] [expires: 2029-03-25]the key ID is AB12CD34EF56GH78
- Initialize
passwith the key ID:
pass init AB12CD34EF56GH78- Login to Docker
docker loginTip
Login to any other registry as needed, for example:
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdinReady to deploy π