Deploy on Hetzner
This guide runs Pratique for a team on one Hetzner Cloud server. A Cloudflare Tunnel brings traffic in, so the server has no open inbound ports. It costs about €18–20 a month.
Architecture
| Part | Choice | Reason |
|---|---|---|
| Server | CX23 (2 vCPU, 4 GB RAM), Ubuntu LTS, EU location | Enough for one instance. Use a CX33 if many CI jobs run at the same time. |
| Data | Hetzner Volume, for example 100 GB, mounted at /data | You can replace or resize the server and keep the data. Not necessary in firewall mode. |
| Inbound traffic | cloudflared tunnel. The Cloud Firewall blocks all other inbound traffic. | The server has no open ports for package traffic. |
| Access control | Cloudflare Access with SSO for the web UI, and a bypass for package and API paths | Package clients cannot do browser SSO. Pratique client tokens protect those paths. |
| Direct registry access | Cloudflare Gateway blocks the public registries for WARP devices | Pratique protects only clients that cannot go around it. |
| Backups | Nightly pratique backup, then a copy to Object Storage with versioning | The SQLite backup is safe while the server runs. |
| Alerts and metrics | PRATIQUE_WEBHOOK_URL, /readyz, and /metrics with PRATIQUE_METRICS_TOKEN | Connect them to your chat and monitoring tools. |
Developers on Cloudflare WARP and CI runners reach Pratique through Cloudflare. Pratique reaches npm, PyPI, Packagist, the Go proxy, OSV and Sigstore over outbound port 443.
Cloudflare is one choice. Another web gateway or proxy works too, if it blocks or redirects the public registries. See redirect at your web gateway.
Deploy it
Create the server
- Create a CX23 server with Ubuntu LTS in an EU location. Add your SSH key.
- Create a Volume (for example 100 GB, ext4), attach it to the server, and mount it at
/data. - Create a Cloud Firewall and attach it to the server. Inbound: allow TCP 22 only from your admin IP address, and nothing else. Outbound: allow all, or if you restrict egress, only TCP 443 and TCP and UDP 7844 (for cloudflared).
- On the server, install Docker and turn on automatic security updates (
unattended-upgrades). - Give the container user write access to the volume:
chown 65532:65532 /data.
Create the tunnel
In Cloudflare Zero Trust, create a tunnel and copy its token. Add a public hostname, for example
pratique.example.com, with the servicehttp://pratique:8484.Write the settings
Put the settings and secrets in
/opt/pratique/.env, then runchmod 600 /opt/pratique/.env.bash/opt/pratique/.envPRATIQUE_PUBLIC_URL=https://pratique.example.com PRATIQUE_RESERVED=@acme/*,acme-*,github.com/acme/* PRATIQUE_OIDC_ISSUER=https://idp.example.com PRATIQUE_OIDC_CLIENT_ID=... PRATIQUE_OIDC_CLIENT_SECRET=... PRATIQUE_OIDC_ALLOWED=@example.com PRATIQUE_ADMINS=alice@example.com PRATIQUE_AUDIT_KEY=... PRATIQUE_METRICS_TOKEN=... PRATIQUE_WEBHOOK_URL=... TUNNEL_TOKEN=...Create
PRATIQUE_AUDIT_KEYwithpratique audit-keygenand keep the public key it prints. With single sign-on set, leavePRATIQUE_ADMIN_TOKENunset. Then no admin token exists that can leak, and Pratique does not generate one.Run Pratique and cloudflared
Use this
/opt/pratique/compose.yaml:yaml/opt/pratique/compose.yamlservices: pratique: image: ghcr.io/justpolidor/pratique:latest # pin a release tag or digest in production restart: unless-stopped env_file: .env environment: PRATIQUE_TRUST_PROXY: "true" # safe: cloudflared is the only way in volumes: - /data:/data read_only: true tmpfs: ["/tmp"] cap_drop: [ALL] security_opt: ["no-new-privileges:true"] # No "ports": only cloudflared reaches Pratique, on the internal network. cloudflared: image: cloudflare/cloudflared:<release> # pin a release tag or digest, and update it on purpose restart: unless-stopped command: tunnel --no-autoupdate run env_file: .env read_only: true cap_drop: [ALL] security_opt: ["no-new-privileges:true"]Replace
<release>with a cloudflared release tag or digest. Start the stack withdocker compose up -d, check the logs for errors, then open the public URL.Cloudflare adds the real client address as the last
X-Forwarded-Forentry, so the audit log records the correct address.Configure Cloudflare Access
Create two Access applications for the hostname:
- Web UI: the whole hostname, with a policy that allows your SSO group.
- Bypass: the paths below, with a Bypass policy. Pratique authenticates them itself.
textpaths to bypass/npm/* /pypi/* /composer/* /go/* package clients /api/inventory /api/builds CI reports /scim/v2/* your identity provider calls it /auth/* single sign-on callbacks /mcp AI triageAn Access application with a more specific path takes priority over the hostname application.
Cloudflare limits the size of a request body, to 100 MB on the Free and Pro plans. A larger private package upload fails. For large uploads, publish from a host that reaches Pratique directly.
Block direct access to the registries
In Cloudflare Gateway, add an HTTP or DNS policy that blocks the public registry hosts for WARP devices. See block direct access for the list. The Hetzner server does not run WARP, so Pratique can still reach the registries.
To send those requests to Pratique instead of blocking them, use redirect rules. See redirect at your web gateway. CI runners that do not run WARP need their own egress rules.
Back up every night
Back up to the volume, then copy the backup to Hetzner Object Storage. Turn on versioning on the bucket.
bash/etc/cron.d/pratique-backup30 2 * * * root docker compose -f /opt/pratique/compose.yaml exec -T pratique /pratique backup /data/backup && rclone sync /data/backup hetzner-os:pratique-backup- Configure the
hetzner-osremote in rclone as S3, with your Object Storage endpoint. - Do not put
PRATIQUE_AUDIT_KEYin the backup. Keep it in a password manager. - Test a restore on a schedule. See back up and restore.
- Configure the
Monitor it
- Monitor
https://pratique.example.com/readyzfrom outside. Add/readyzto the Access bypass list, or monitor it from the server. - Collect
/metricswith the token inPRATIQUE_METRICS_TOKEN. Add the path to the bypass list if your Prometheus is outside Cloudflare Access. - Send alerts to your chat with
PRATIQUE_WEBHOOK_URL.
See monitoring and audit log for metric names and alerts.
- Monitor
Cost
These are estimates. Hetzner changed its prices in 2026, so check the current prices before you plan a budget.
| Item | Per month |
|---|---|
| CX23 server with IPv4 | about €6 |
| 100 GB Volume | about €6 |
| Object Storage, base price | about €6.50 |
| Cloudflare Tunnel and Access (Zero Trust Free, up to 50 users) | €0 |
| Total | about €18–20 |
Before you use it for a company
- The audit log stores email addresses and IP addresses. Ask your data protection officer before you start.
- Run it in a company cloud account, not a personal one, because it holds internal package names.
Grow to more than one instance
Put two servers behind a Hetzner Load Balancer. Run Postgres on a third server, because Hetzner has no managed
Postgres. Store package files in Object Storage with PRATIQUE_S3_BUCKET and
PRATIQUE_S3_ENDPOINT. See run more than one
instance.