WIUNIX ACADEMY
Private Docker registry with Nginx HTTPS and native authentication
Build an authenticated private OCI registry on Ubuntu, Debian, RHEL-family or Arch systems; verify HTTPS push/pull and plan consistent storage maintenance.
Make this guide yoursYOUR SYSTEM. YOUR STEPS.
Where are you working?
Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.
USE YOUR OWN VALUES
Configure this tutorial
Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.
Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.
Set values for my environment8 editable values
THE OUTCOME
What will you have at the end?
Push and pull private OCI images over trusted HTTPS while retaining data and authentication.
Supported operating systems and versions
Documented DEB/RHEL/Arch paths; historical isolated protocol checks and outstanding operational acceptance are distinguished below.
- Ubuntu 26.10
- Ubuntu 26.04 LTS
- Ubuntu 24.04 LTS
- Debian 13
- Debian 12
- RHEL 10.2 (standard channel)
- RHEL 9.8 (standard channel)
- Rocky Linux 10.2 (standard channel)
- Rocky Linux 9.8 (standard channel)
- AlmaLinux 10.2 (standard channel)
- AlmaLinux 9.8 (standard channel)
- Arch Linux rolling · 2026-11-05
- Manjaro rolling · 2026-11-05 · stable
Before you begin
- Fresh dedicated VM and existing rootful Docker Engine ≥28; selected OS remains a documented path.
- Trusted certificate/chain/key, DNS, TCP443 and an initialized client credential helper.
- RPM hosts additionally require SELinux Enforcing and an existing Engine configured with SELinux support; stop and reconcile that prerequisite before this guide.
A private registry with a clear trust boundary
Build a single-node OCI image registry on a fresh dedicated Linux VM. Nginx terminates trusted HTTPS for registry.example.net; Distribution is published only at host loopback port 5000. Persistent data lives below /srv/academy-registry. This is an intermediate operations exercise, about 60 minutes plus certificate and backup preparation.
Native bcrypt authentication gives every enrolled user broad registry access. It is not repository-level RBAC, a vulnerability scanner, image signing or a highly available service. Choose a token authorization service before admitting mutually untrusted teams. A basic-auth password is protected by TLS; HTTPS must work before credentials are sent.
Set public examples before copying
Open the configuration form, edit the public values, press Apply, then copy. Pending or invalid edits disable copy. Defaults are examples, not evidence of installation. Never enter passwords, HTTP signing secrets, private keys or tokens in this form.
Values and custom progress stay in sessionStorage for this tab, language, article and OS environment. Default progress uses localStorage. Reset restores reviewed examples. Changing a value does not create DNS, reserve a port, change a firewall or execute a command.
Prepare the VM, clients and certificate
Use a fresh dedicated VM with sudo, sufficient disk/inodes for layers and backups, enabled signed distribution repositories, and an already installed rootful real Docker Engine ≥28. A docker command pointing to Podman is insufficient. Follow the OS owning installation method and avoid mixing Docker CE and conflicting distro packages. Plan any necessary engine upgrade separately before this exercise; older Engine loopback-publishing defects are a reason to stop.
Provide an IPv4 A record reaching this VM, intended-network TCP443, a current full certificate chain for registry.example.net, matching key and renewal procedure. This recipe listens on IPv4 only: do not publish an AAAA record until a separately reviewed IPv6 listener and firewall path are ready. Public issuance/ACME is outside this recipe; for a private CA, distribute managed CA trust to every client and Docker daemon before login.
Linux test clients need Docker, Python and an initialized pass credential helper with a usable GPG key. Other platforms may use their native helper, but that path was not executed here. Fix helper initialization rather than falling back to a base64 credential in JSON.
LET’S BUILD
Check engine, names, UID and ports
On the fresh VM, require a real rootful Docker Engine server component, not a Podman compatibility endpoint, and Engine major version at least28. Check the unused container name and reserve numeric UID/GID 23153 in your inventory. These checks do not create a host login. Port checks run after utility installation so this initial check does not require Python on a minimal host.
Registry VM
set -eu
sudo docker version --format '{{range .Server.Components}}{{println .Name}}{{end}}' | grep -Fx Engine
engine_version=$(sudo docker version --format '{{.Server.Version}}')
engine_major=${engine_version%%.*}
case "$engine_major" in ''|*[!0-9]*) exit 1;; esac
test "$engine_major" -ge 28
security=$(sudo docker info --format '{{json .SecurityOptions}}')
printf '%s\n' "$security"
case "$security" in *rootless*) exit 1;; esac
if sudo docker container inspect 'academy-registry' >/dev/null 2>&1; then exit 1; fi
if getent passwd '23153' >/dev/null; then exit 1; fi
if getent group '23153' >/dev/null; then exit 1; fi
test "$(getenforce)" = Enforcing
printf '%s\n' "$security" | grep -F selinux
Real rootful Engine ≥28, unused container name and free numeric UID/GID; no service changed.
LET’S BUILD
Install only the host-side utilities
Install only host utilities on this fresh dedicated VM; Distribution comes from the pinned image. Debian/Ubuntu use apache2-utils, RPM uses httpd-tools, and Arch uses apache for htpasswd without starting Apache. Nginx may start automatically on Debian/Ubuntu; check ports again after installation.
RPM paths use the enabled supported BaseOS/AppStream channels, without switching streams or adding EPEL/CRB. The standard-channel reviewed minors are9.8 and10.2; an older RHEL EUS minor requires its own active entitlement and package review. Arch/Manjaro installation explicitly performs a full system upgrade: review the transaction and reboot requirements first, on this fresh VM. Never mix Arch repositories into Manjaro.
Registry VM
set -eu
. /etc/os-release
test "$ID" = 'rocky'
test "$VERSION_ID" = '9.8'
sudo dnf repolist --enabled
sudo dnf info nginx httpd-tools python3 container-selinux
sudo dnf install nginx httpd-tools python3 openssl ca-certificates curl nano iproute policycoreutils-python-utils container-selinux audit
rpm -q nginx httpd-tools python3 container-selinux
sudo python3 - <<'PY'
import socket
for port in (443, 5000):
with socket.socket() as s:
s.bind(('0.0.0.0',port))
print('Required IPv4 ports are currently free')
PY
Selected OS matches; installed packages are listed and required ports are currently available.
LET’S BUILD
Reserve storage and open a protected password editor
Run on the VM. The absolute path /srv/academy-registry must be a new child below an existing real /srv directory. Every existing path component is checked for symlinks; existing data is never adopted or recursively chowned. The numeric registry process owns only its data directory. Root retains auth/config ownership; the container GID can read them.
In the root-only editor enter one randomly generated password, a single line of 20–72 printable ASCII bytes without spaces. Obtain it from your approved password manager; do not put it in a shell argument, browser form, screenshot or command history. Save and close. The plaintext file is temporary and root-only.
Registry VM
sudo python3 - <<'PY'
import os
from pathlib import Path
p=Path('/srv/academy-registry')
assert p.is_absolute() and len(p.parts)>=3 and p.parts[1]=='srv'
for part in [p,*p.parents]:
assert not part.is_symlink(), 'Symlink path rejected'
assert p.parent.is_dir() and not p.exists(), 'Fresh dedicated path required'
os.mkdir(p,0o750)
os.chown(p,0,23153)
for name in ('data','auth','config','tls','recovery'):
d=p/name; os.mkdir(d,0o700)
if name=='data': os.chown(d,23153,23153)
elif name in ('auth','config'):
os.chown(d,0,23153); os.chmod(d,0o750)
f=p/'auth/password-input'
fd=os.open(f,os.O_WRONLY|os.O_CREAT|os.O_EXCL|os.O_NOFOLLOW,0o600)
os.close(fd)
print('Dedicated directories reserved; protected password editor file is empty')
PY
sudo nano '/srv/academy-registry/auth/password-input'
New protected directories exist; password-input is root-owned 0600.