Deployment
Piwi is one Node.js server with its data in one directory. Run it as a Docker container (recommended), with Docker Compose, on Kubernetes or with npx, then put an HTTPS proxy in front of it.
Docker (recommended)
Quick start
docker pull phenx/piwitests-server:latest
mkdir -p .data && sudo chown -R 1001:1001 .data # the container runs as non-root UID 1001
# Reachable from this machine only: with authentication off, anyone who reaches the port is an administrator.
# Publish it on every interface (-p 3000:3000) only once authentication is on.
docker run -p 127.0.0.1:3000:3000 -v $(pwd)/.data:/app/.data phenx/piwitests-server:latestdocker pull phenx/piwitests-server:latest
# Reachable from this machine only: with authentication off, anyone who reaches the port is an administrator.
# Publish it on every interface (-p 3000:3000) only once authentication is on.
docker run -p 127.0.0.1:3000:3000 -v ${PWD}/.data:/app/.data phenx/piwitests-server:latestThe dashboard will be available at http://localhost:3000.
Linux hosts: without the
chown, Docker auto-creates.dataowned byrootand the container (non-root UID 1001) can't write to it. Docker Desktop on Windows/macOS handles this automatically. See Permission issues with volumes if you hit a permission error.
Registries
The same multi-arch image is published to two registries; use whichever your organization prefers:
docker pull phenx/piwitests-server:latestdocker pull ghcr.io/piwitests/platform:latestGHCR additionally carries an edge tag rebuilt from every push to main. It's useful for trying a fix before its release; don't run it in production: it has had no release testing and can change under you.
Available tags
| Tag | Description | Docker Hub | GHCR |
|---|---|---|---|
latest | Latest stable release | ✅ | ✅ |
MAJOR.MINOR.PATCH | One exact release (e.g. 0.26.1) | ✅ | ✅ |
MAJOR.MINOR | Latest patch of that minor (e.g. 0.25) | ✅ | ✅ |
MAJOR | Latest release of that major (e.g. 0) | ✅ | ✅ |
edge | Built from every push to main | — | ✅ |
Pin a specific version in production, and read Upgrading before you bump it, because migrations are forward-only. Browse the published tags on Docker Hub or GHCR.
Image details
| Property | Value |
|---|---|
| Base image | node:24-alpine, pinned by digest |
| Image size | ~400 MB |
| Platforms | linux/amd64, linux/arm64 |
Volumes
Everything the server keeps lives under /app/.data, the volume the quick start mounts: the SQLite database (piwi.db) and file storage (storage/, HTML reports and traces). Mount it on persistent storage, or point the database and storage elsewhere.
Environment variables
The server reads three process-level variables directly:
| Variable | Default | Description |
|---|---|---|
NODE_ENV | production | Set automatically |
HOST | 0.0.0.0 | Listen on all interfaces. The Docker image sets NITRO_HOST=0.0.0.0, which takes precedence — override the bind address there with NITRO_HOST. npx @piwitests/server defaults to 127.0.0.1 |
PORT | 3000 | Application port |
Everything else is a PIWI_* variable, listed with its default and the Settings page that names it in the generated configuration reference. The configuration generator turns your choices into a ready-to-paste block from the same registry.
One-click deploy
No server to run Docker on? Templates for Railway, Render, Fly.io, Koyeb and Coolify / Dokploy stand up the same single container with authentication on and a persistent volume, which on Koyeb you attach yourself. One-click deploy covers each provider and what to check before you rely on it.
Docker Compose
The repository ships a ready-to-use docker-compose.yml with commented options (secret key, auth, PostgreSQL). Minimal version:
services:
piwi:
image: phenx/piwitests-server:latest
ports:
- "127.0.0.1:3000:3000" # "3000:3000" once authentication is on
volumes:
- ./.data:/app/.data
restart: unless-stoppedRun with:
docker compose up -dWith authentication off, a reporter in another container that sends to http://piwi:3000 needs PIWI_ALLOWED_HOSTS=piwi in the dashboard's environment (the host allowlist).
Docker Compose with PostgreSQL
For production deployments requiring a robust relational database:
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: piwi
POSTGRES_PASSWORD: change-me
POSTGRES_DB: piwi
volumes:
- pg-data:/var/lib/postgresql/data
restart: unless-stopped
piwi:
image: phenx/piwitests-server:latest
ports:
- "127.0.0.1:3000:3000" # "3000:3000" once authentication is on
volumes:
- ./.data:/app/.data # still used for report/trace file storage
environment:
- PIWI_DATABASE_URL=postgresql://piwi:change-me@postgres:5432/piwi
depends_on:
- postgres
restart: unless-stopped
volumes:
pg-data:Run with:
docker compose up -dKubernetes
Example deployment manifest. It reads its variables from the piwi-config ConfigMap and the piwi-secrets Secret that the configuration generator's Kubernetes output creates: apply that first.
apiVersion: apps/v1
kind: Deployment
metadata:
name: piwi-dashboard
spec:
replicas: 1
strategy:
type: Recreate # never two pods at once, not even during a rollout
selector:
matchLabels:
app: piwi-dashboard
template:
metadata:
labels:
app: piwi-dashboard
spec:
securityContext:
fsGroup: 1001 # the image's non-root user, so it can write the volume
containers:
- name: piwi-dashboard
image: phenx/piwitests-server:0.77.0 # x-release-please-version
ports:
- containerPort: 3000
envFrom:
- configMapRef:
name: piwi-config
- secretRef:
name: piwi-secrets
optional: true
readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 20
periodSeconds: 30
volumeMounts:
- name: data
mountPath: /app/.data
volumes:
- name: data
persistentVolumeClaim:
claimName: piwi-dashboard-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: piwi-dashboard-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: piwi-dashboard
spec:
selector:
app: piwi-dashboard
ports:
- port: 80
targetPort: 3000
type: ClusterIPThe Service stays inside the cluster: publish it through your Ingress with TLS, rather than as a plain-HTTP LoadBalancer, with the proxy settings of Reverse proxy (HTTPS). With authentication off, a pod that calls the Service by name needs that name in PIWI_ALLOWED_HOSTS (piwi-dashboard, or the full piwi-dashboard.<namespace>.svc.cluster.local); the probes call the pod's IP address and need nothing.
npm / npx (quick local run)
For a quick local run without Docker, the server is published to npm as @piwitests/server. It bundles the prebuilt server and needs only Node.js 22+:
npx @piwitests/serverThe dashboard will be available at http://localhost:3000.
The server creates the same .data/ layout in the current working directory, so run the command from the same directory each time to keep your data. It reads the same environment variables as the Docker image; for example, to change the port:
PORT=8080 npx @piwitests/server$env:PORT='8080'; npx @piwitests/serverIt listens on 127.0.0.1 only, so other machines cannot reach it: with authentication off, the default, anyone who reaches the port is an administrator. To serve other machines, turn authentication on, set HOST=0.0.0.0 and put HTTPS in front: the session cookie is Secure, so sign-in over plain http:// works only on localhost.
Docker remains the recommended path for production: it ships a pinned Node runtime, runs as a non-root user and isolates the environment.
Health checks
GET /api/health verifies database connectivity and returns 200 {"status":"ok","database":"ok"} when healthy, 503 {"status":"error","database":"unreachable"} otherwise — use it for load-balancer targets, uptime monitors, and container orchestration. The Docker image ships a built-in HEALTHCHECK against it, so docker ps shows healthy/unhealthy out of the box. The version endpoint additionally reports the running version and database backend (Upgrading).
Reverse proxy (HTTPS)
Always put a TLS-terminating reverse proxy in front of the dashboard for anything beyond localhost: with authentication on, browser sign-in needs HTTPS, since the session cookie is Secure and plain http:// works only on localhost. A proxy gets two things wrong by default, which the nginx examples below set:
- Upload size. Trace and report uploads reach hundreds of MB: one upload (a report, or one test's files) is accepted up to
PIWI_IMPORT_MAX_BYTES, 500 MB by default, and a run's results sent as one JSON document up toPIWI_SUBMIT_MAX_BYTES, 256 MB by default. Raise the proxy's body limit to match (client_max_body_sizein nginx), or lower those limits to the proxy's. - Stream buffering. Live runs, browser notifications and the live view hold long-lived responses open, the CI workers' included: the proxy must pass them through unbuffered and keep them open (
proxy_buffering offand a longproxy_read_timeoutin nginx). Behind a buffering proxy the run page stops updating, and the live view's Watch shows no image.
Caddy (automatic HTTPS):
piwi.example.com {
reverse_proxy localhost:3000
}nginx:
server {
listen 443 ssl;
http2 on; # nginx 1.25.1 or later; before it, `listen 443 ssl http2;`
server_name piwi.example.com;
# ssl_certificate /etc/letsencrypt/live/piwi.example.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/piwi.example.com/privkey.pem;
client_max_body_size 500m; # trace + report uploads
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Live runs, notifications and the live view are long-lived streams:
proxy_buffering off;
proxy_read_timeout 1h;
}
}Each stream also carries X-Accel-Buffering: no, which nginx obeys even with proxy_buffering on and keeps from the browser. With two proxies in a row (a front nginx before ingress-nginx, say) the inner one keeps it from the outer one, which buffers: turn proxy_buffering off on the outer one too. A proxy not built on nginx ignores the header.
ingress-nginx leaves responses unbuffered unless its ConfigMap turns proxy-buffering on; the same settings as annotations on the Ingress:
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "500m"
nginx.ingress.kubernetes.io/proxy-buffering: "off"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"Serve the dashboard over HTTP/2 when people keep several tabs open. Over HTTP/1.1, plain HTTP or HTTPS without HTTP/2, a browser opens at most six connections to one address, and each Piwi page that follows a running run holds one: a run page that finds none left says Live updates stalled. Caddy speaks HTTP/2 by default; nginx needs http2 on, as above.
Set PIWI_SITE_URL to the public HTTPS URL, so email links and OAuth callbacks point at the right origin, and PIWI_TRUST_PROXY=true (step 4 of the production checklist). Have the proxy forward the browser's Host header, as the examples do: with authentication off, the host allowlist reads it.
Resource requirements
Piwi is a single Node.js process and runs comfortably on small machines:
| Deployment | Guideline |
|---|---|
| RAM | ~300 MB idle; 1 GB is comfortable headroom for large uploads and AI diagnosis |
| CPU | 1 vCPU is enough for a team; ingest is I/O-bound |
| Disk | The real variable — traces and HTML reports dominate. Budget by retention: e.g. ~50–200 MB per run with traces enabled. Prune old runs from Settings → Storage |
| Scaling | Run a single replica. SQLite requires it; with PostgreSQL the SSE event bus is still in-process, and so is whether a Run on my machine app is online and the live view's relay (sticky sessions do not help: a run's setup, its CI workers and its viewers are separate clients), so keep one instance |
Security
Before you put an instance on a shared address, work down the production checklist.
Troubleshooting
Permission issues with volumes
On Linux hosts, the bind-mounted directory must be writable by the container's UID 1001:
mkdir -p .data
sudo chown -R 1001:1001 .data # match the container's non-root UID 1001
docker run -p 127.0.0.1:3000:3000 -v $(pwd)/.data:/app/.data phenx/piwitests-server:latestOn Windows and macOS, Docker Desktop manages volume permissions automatically — no
chownis needed. Just run the container with-v ${PWD}/.data:/app/.data(PowerShell).
Database locked
SQLite doesn't support concurrent writes well. For high-concurrency deployments, run a single instance or switch to PostgreSQL by setting PIWI_DATABASE_URL.
Port already in use
Map to a different host port:
docker run -p 127.0.0.1:8080:3000 -v $(pwd)/.data:/app/.data phenx/piwitests-server:latestdocker run -p 127.0.0.1:8080:3000 -v ${PWD}/.data:/app/.data phenx/piwitests-server:latestThe dashboard will be available at http://localhost:8080.
Related
- One-click deploy: templates for hosting providers
- Production checklist: what to set before anyone else can reach the instance
- Backup & restore: what to copy, and how to restore it
- Upgrading: moving to a new version