Self-Hosting
You can run the full Pia stack on your own infrastructure using Docker Compose.
Requirements
Section titled “Requirements”- Docker and Docker Compose
- A domain with DNS configured
- 1 GB RAM minimum
Quick Start
Section titled “Quick Start”- Get the deployment bundle:
Pia Server is source-available. Request the server source, the deployment files used below
(docker-compose.prod.yml, .env.example, Caddyfile) and access to the container images from
kontakt@pia-ai.de — the same address that issues the licence. Unpack what you get
back, then run the remaining steps from that directory.
- Copy and configure the environment file:
cp .env.example .env.prod- Set the required environment variables in
.env.prod:
JWT_SECRET_KEY=<generate-a-random-64-char-string>ENCRYPTION_MASTER_KEY=<generate-a-random-64-char-string>POSTGRES_PASSWORD=<strong-password>- Start the services:
docker compose -f docker-compose.prod.yml up -dArchitecture
Section titled “Architecture”The production stack consists of:
| Service | Image | Port | Purpose |
|---|---|---|---|
| Caddy | caddy:2-alpine |
80, 443 | Reverse proxy + auto HTTPS |
| Pia Server | ghcr.io/pia-ai-dev/pia-server |
8080 | API server |
| PostgreSQL | postgres:17-alpine |
5432 | Database |
Caddy Configuration
Section titled “Caddy Configuration”Update the Caddyfile with your domain:
your-domain.com { reverse_proxy pia-server:8080}Caddy handles TLS certificate provisioning automatically via Let’s Encrypt.
Updating
Section titled “Updating”docker compose -f docker-compose.prod.yml pulldocker compose -f docker-compose.prod.yml up -d