
Self-hosting Docker Registry the easy way
Yulei ChenThe Docker Registry (also known as Distribution) is the open-source engine behind Docker Hub, GitHub Container Registry, and most other container registries. Running your own gives you full control over where your images live, no pull rate limits, and zero per-image costs. Docker Hub's free tier caps you at one private repository, and paid plans start at $7/month with storage limits.
Sliplane is a managed container platform that makes self-hosting painless. With one-click deployment, you can get a private Docker Registry up and running in minutes - no server setup, no reverse proxy config, no infrastructure to maintain.
Prerequisites
Before deploying, ensure you have a Sliplane account (free trial available).
Quick start
Sliplane provides one-click deployment with presets.
- Click the deploy button above
- Select a project
- Select a server (If you just signed up you get a 48-hour free trial server)
- Click Deploy!
About the preset
The one-click deploy above uses Sliplane's Docker Registry preset. Here's what it includes:
- Official registry image (
registry:3.1.1) based on Distribution v3 - Specific version tag for stability
- Persistent storage mounted to
/var/lib/registryso your images survive restarts - Healthcheck on
/v2/(the registry API base path) - No authentication by default (see below for how to add it)
Next steps
Once the registry is running on Sliplane, access it using the domain Sliplane provided (e.g. docker-registry-xxxx.sliplane.app).
Pushing your first image
Tag a local image with your registry's domain and push it:
docker tag my-app:latest docker-registry-xxxx.sliplane.app/my-app:latest
docker push docker-registry-xxxx.sliplane.app/my-app:latest
To pull the image on another machine:
docker pull docker-registry-xxxx.sliplane.app/my-app:latest
For more details on tagging and pushing, check out our guides on how to use docker tag and how to use docker push.
Adding authentication
The preset deploys without authentication for simplicity. For production use, you should add basic auth. You can do this by setting these environment variables in Sliplane and adding a custom start command.
Add these environment variables in your service settings:
| Variable | Value |
|---|---|
USERNAME | admin (or your preferred username) |
PASSWORD | A strong password |
REGISTRY_AUTH | htpasswd |
REGISTRY_AUTH_HTPASSWD_REALM | Registry Realm |
REGISTRY_AUTH_HTPASSWD_PATH | /auth/registry.password |
Then set the Command field to:
sh -c 'apk add --no-cache apache2-utils && mkdir -p /auth && htpasswd -Bbc /auth/registry.password "$USERNAME" "$PASSWORD" && registry serve /etc/docker/registry/config.yml'
This installs the htpasswd utility, generates the password file, and starts the registry. After redeploying, log in before pushing:
docker login docker-registry-xxxx.sliplane.app
Storage
All pushed images are stored in /var/lib/registry, which is backed by a persistent volume. This means your images are safe even if the container restarts. You can check how much storage your images use in the Sliplane dashboard under your server's volume section.
Garbage collection
Over time, deleted image tags can leave unused layers (blobs) on disk. The registry ships with a built-in garbage collector. You can run it via docker exec:
registry garbage-collect /etc/docker/registry/config.yml
Logging
The registry logs to STDOUT by default, which works well with Sliplane's built-in log viewer. You can adjust the log level by setting the REGISTRY_LOG_LEVEL environment variable to debug, info, warn, or error. For general Docker log tips, check out our post on how to use Docker logs.
Cost comparison
You can also self-host a Docker Registry with other cloud providers. Here is a pricing comparison for the most common ones:
| Provider | vCPU | RAM | Disk | Monthly Cost | Note |
|---|---|---|---|---|---|
| Sliplane | 2 | 2 GB | 40 GB | €9 (~$10.65) | Flat rate, 1 TB bandwidth, SSL included |
| Fly.io | 2 | 2 GB | 40 GB | ~$18 | Disk and bandwidth billed separately |
| Render | 1 | 2 GB | 40 GB | ~$35 | 100 GB bandwidth, Disk billed separately |
| Railway | 2 | 2 GB | 40 GB | ~$67 + $20 plan | Pro plan floor, usage-based, bandwidth billed separately |
Click here to see how these numbers were calculated.
(Assuming an always-on instance running 730 hrs/month)
- Sliplane: flat €9/month for the Base server. Unlimited services on the same server, 1 TB egress and SSL included.
- Fly.io:
shared-cpu-2x2 GB = $11.83/mo + 40 GB volume × $0.15/GB = $6 -> ~$17.83/mo. Egress billed separately ($0.02/GB in EU). - Render: closest match is Standard ($25, 1 vCPU / 2 GB) plus 40 GB disk × $0.25/GB = $10 -> ~$35/mo. Stepping up to Pro (2 vCPU / 4 GB) costs $85/mo + disk.
- Railway (Pro plan): CPU 2 × $0.00000772/s × 2,628,000 s = $40.57; RAM 2 × $0.00000386/s × 2,628,000 s = $20.29; volume 40 × $0.00000006/s × 2,628,000 s = $6.31 -> ~$67/mo compute, plus the $20/mo Pro plan floor and $0.05/GB egress.
Bandwidth costs can add up fast on usage-based providers. Use our bandwidth cost comparison tool to see what your egress would cost on each platform.
FAQ
Why would I run my own Docker Registry instead of using Docker Hub?
A private registry gives you unlimited private repositories, no pull rate limits, and full control over your data. It's especially useful for CI/CD pipelines that push and pull frequently, or if your images contain proprietary code you don't want on a third-party service.
Can I use my registry with Sliplane's custom registry feature?
Yes. Sliplane supports deploying from custom registries. Once your registry is running, you can configure it as a deployment source for other services on Sliplane.
How do I update the Docker Registry?
Change the image tag in your service settings (e.g. from registry:3.1.1 to a newer version) and redeploy. Check Docker Hub for the latest stable version.
How much storage do I need?
It depends on your image sizes and how many versions you keep. A typical web application image is 100-500 MB. The default 40 GB volume on Sliplane's Base server can hold dozens of images. You can upgrade to a larger server if you need more space.
Can I use Docker Compose with my private registry?
Yes. In your compose.yml, reference images with your registry's full domain:
services:
web:
image: docker-registry-xxxx.sliplane.app/my-app:latest
For more on Docker Compose, see our guide on how to use Docker Compose.