Docker

Host Docker Registry on VeloxaHost

Docker Registry is the reference server for storing and distributing container images, the same push and pull API that Docker Hub speaks. Teams self-host it to keep private images close to their servers and avoid per-seat or pull-rate limits on hosted registries.

The one-click deploy pulls registry:2 from Docker Hub and starts it with 1 vCPU, 512 MB of memory and a 5 GB disk. It serves the registry API over plain HTTP on port 5000 with the image's default configuration: no TLS, no login, and images stored under /var/lib/registry.

What that means in practice

Anyone who can reach port 5000 can push and pull. That is acceptable for a short test on a port you have not forwarded, or behind a VeloxaHost firewall that allows only your own addresses, but not for a registry other people can find. Docker clients also refuse plain HTTP registries other than localhost unless you list them under insecure-registries in /etc/docker/daemon.json.

The container cannot be reconfigured from the console: the image is Alpine-based and has no bash, so the browser terminal (which opens bash) does not start a shell in it, and there is no SSH. A 5 GB disk also fills quickly, since a single application image is often hundreds of megabytes. For a registry you will keep, use the route below on a full server, where you control the configuration and the disk.

The registry:2 tag is the 2.8 line. The project, now called Distribution under the CNCF, ships version 3 as registry:3.

Sizing

The registry itself is light; disk is what matters. Every pushed layer is stored once and shared between tags, but deleted tags leave their layers on disk until garbage collection runs. Plan disk for your images times the versions you keep.

Install it yourself

On an Ubuntu 24.04 server with a dedicated IPv4 address (ports 80 and 443 on IPv4 need one: a paid add-on with limited availability; IPv6 is not available in US East yet) and a DNS name pointing at it:

  1. Turn on Docker support on the server page, then install Docker, Caddy and the htpasswd tool.
    apt install -y docker.io caddy apache2-utils
    
  2. Create a login. The registry accepts only bcrypt entries.
    mkdir -p /srv/registry/auth
    htpasswd -Bbn deploy 'a-long-random-password' > /srv/registry/auth/htpasswd
    
  3. Start the registry on localhost only, with storage and auth mounted.
    docker run -d --name registry --restart=always -p 127.0.0.1:5000:5000 \
      -v /srv/registry/data:/var/lib/registry -v /srv/registry/auth:/auth \
      -e REGISTRY_AUTH=htpasswd -e REGISTRY_AUTH_HTPASSWD_REALM=Registry \
      -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd registry:3
    
  4. Let Caddy obtain a certificate and proxy to it.
    printf 'registry.example.com {\n  reverse_proxy 127.0.0.1:5000\n}\n' > /etc/caddy/Caddyfile
    systemctl reload caddy
    
  5. From your laptop or CI: docker login registry.example.com, then tag and push.

FAQ

How do I free disk after deleting images?

Run garbage collection, ideally with the registry stopped or in read-only mode so a push cannot race it: docker exec registry registry garbage-collect /etc/distribution/config.yml. Deleting manifests through the API needs REGISTRY_STORAGE_DELETE_ENABLED=true.

How do I back up the registry?

Everything is in the storage directory, /srv/registry/data in the route above. Schedule server snapshots (hourly to weekly, kept 1 to 30 days) or backups (keep the last 1 to 10), or copy the directory elsewhere.

Can it store images in S3-compatible storage instead of on disk?

Yes. Distribution has an s3 storage driver, and VeloxaHost Object Storage is S3-compatible, so the disk then only needs room for the registry itself.

What license is the registry under?

Distribution is released under the Apache License 2.0.

Which VeloxaHost size fits it?

A Veloxa Nano covers the recommended size: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at the monthly price. Many large images call for a Veloxa 1 with 50 GB of disk, for $8.