Container Registries
Use private registry images by storing per-host credentials.
Sandboxes and snapshots can boot from images in private container registries — GitHub Container Registry, a private Docker Hub repository, Google Artifact Registry, Amazon ECR, or any registry that speaks basic auth. Daytona stores one credential per registry host per project. From then on, any image build or sandbox create that references an image on that host authenticates automatically; there is no per-create credential field to pass and nothing extra in your SDK code.
The host is derived from the image reference the same way Docker derives it: ghcr.io/acme/app:latest resolves to ghcr.io, while a bare reference like node:20 or library/ubuntu:22.04 resolves to Docker Hub. If the project has a credential stored for that host, the pull is authenticated; otherwise it proceeds anonymously.
Adding a registry credential
Store a credential with PUT /registries/:host (or PUT /registries with the host in the body). Registries are managed via REST and the Registries page in the dashboard.
Note: there is no SDK service for registries yet — use REST or the dashboard. Once the credential is stored, SDK sandbox creates that reference the host authenticate automatically.
| Field | Required | Default | Notes |
|---|---|---|---|
kind | no | basic | One of basic, ghcr, gcr, ecr |
username | yes | — | Registry username (see recipes below) |
password | yes | — | Password or token; write-only, max 64 KiB |
description | no | — | Free-form note |
Rules the API enforces:
- Host format. The host must be a bare
host[:port]— no scheme, path, or trailing slash. Hosts are lowercased, and Docker Hub aliases (docker.io,registry-1.docker.io,registry.hub.docker.com) all normalize to the canonicalindex.docker.io, so looking up or deletingdocker.iofinds the same credential. - Kind/host cross-validation. A misconfigured credential fails at write time rather than silently at pull time:
ghcrrequires hostghcr.io;gcrrequiresgcr.io,*.gcr.io,pkg.dev, or a*-docker.pkg.devhost;ecrrequires an*.dkr.ecr.<region>.amazonaws.comhost.basicworks with any host. - Write-only passwords. Passwords are encrypted at rest and never returned by any endpoint. Updating a credential replaces it in place (the
PUTis an upsert and returns204).
Recipes
GitHub Container Registry (GHCR). Use your GitHub username and a personal access token with the read:packages scope as the password:
Private Docker Hub. Use your Docker Hub username and an access token (or password). Any Docker Hub alias works as the host — it is stored under index.docker.io:
Once stored, private images from that host just work — for example creating a sandbox from a private GHCR image:
The same applies to snapshot builds whose base image lives on a credentialed host.
Managing credentials
Listing and fetching return metadata only — host, kind, username, description, and last update time — never the password. Deletion is idempotent and returns 204.
To rotate a credential, simply PUT the same host again with the new password — subsequent pulls use the new value.
See also
- Image sources — how image references are resolved when creating sandboxes.
- Secrets — the related mechanism for API keys and other credentials your code needs.