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

PartChoiceReason
ServerCX23 (2 vCPU, 4 GB RAM), Ubuntu LTS, EU locationEnough for one instance. Use a CX33 if many CI jobs run at the same time.
DataHetzner Volume, for example 100 GB, mounted at /dataYou can replace or resize the server and keep the data. Not necessary in firewall mode.
Inbound trafficcloudflared tunnel. The Cloud Firewall blocks all other inbound traffic.The server has no open ports for package traffic.
Access controlCloudflare Access with SSO for the web UI, and a bypass for package and API pathsPackage clients cannot do browser SSO. Pratique client tokens protect those paths.
Direct registry accessCloudflare Gateway blocks the public registries for WARP devicesPratique protects only clients that cannot go around it.
BackupsNightly pratique backup, then a copy to Object Storage with versioningThe SQLite backup is safe while the server runs.
Alerts and metricsPRATIQUE_WEBHOOK_URL, /readyz, and /metrics with PRATIQUE_METRICS_TOKENConnect 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

  1. Create the server

    1. Create a CX23 server with Ubuntu LTS in an EU location. Add your SSH key.
    2. Create a Volume (for example 100 GB, ext4), attach it to the server, and mount it at /data.
    3. 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).
    4. On the server, install Docker and turn on automatic security updates (unattended-upgrades).
    5. Give the container user write access to the volume: chown 65532:65532 /data.
  2. 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 service http://pratique:8484.

  3. Write the settings

    Put the settings and secrets in /opt/pratique/.env, then run chmod 600 /opt/pratique/.env.

    bash/opt/pratique/.env
    PRATIQUE_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_KEY with pratique audit-keygen and keep the public key it prints. With single sign-on set, leave PRATIQUE_ADMIN_TOKEN unset. Then no admin token exists that can leak, and Pratique does not generate one.

  4. Run Pratique and cloudflared

    Use this /opt/pratique/compose.yaml:

    yaml/opt/pratique/compose.yaml
    services:
      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 with docker compose up -d, check the logs for errors, then open the public URL.

    Cloudflare adds the real client address as the last X-Forwarded-For entry, so the audit log records the correct address.

  5. 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 triage

    An 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.

  6. 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.

  7. 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-backup
    30 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-os remote in rclone as S3, with your Object Storage endpoint.
    • Do not put PRATIQUE_AUDIT_KEY in the backup. Keep it in a password manager.
    • Test a restore on a schedule. See back up and restore.
  8. Monitor it

    • Monitor https://pratique.example.com/readyz from outside. Add /readyz to the Access bypass list, or monitor it from the server.
    • Collect /metrics with the token in PRATIQUE_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.

Cost

These are estimates. Hetzner changed its prices in 2026, so check the current prices before you plan a budget.

ItemPer month
CX23 server with IPv4about €6
100 GB Volumeabout €6
Object Storage, base priceabout €6.50
Cloudflare Tunnel and Access (Zero Trust Free, up to 50 users)€0
Totalabout €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.