Tutorial10 min read
Self-Hosting OpenPieces: A Complete Guide
Everything you need to deploy and manage your own OpenPieces instance.
Danny Truong @dtruong·February 28, 2025
Why Self-Host?
Self-hosting gives you full control over your data, workflows, and infrastructure. No data ever leaves your network. No third-party API calls. No usage limits.
Requirements
- A Linux server (Ubuntu 22.04+ or Debian 12+ recommended)
- Docker and Docker Compose
- A PostgreSQL database (14+)
- At least 4GB of RAM
- A domain name with SSL (optional but recommended)
Step 1: Clone the Repository
bashgit clone https://github.com/openpieces/openpieces.git cd openpieces
Step 2: Configure Environment
Copy the example environment file and adjust the values:
bashcp .env.example .env
The key variables to set are:
DATABASE_URL— your PostgreSQL connection stringJWT_SECRET— a random 64-character stringSTORAGE_BACKEND— local or S3-compatible
Step 3: Start the Services
bashdocker compose up -d
This starts three services:
- The API server on port 3000
- The worker process for executing pieces
- A Postgres instance (if you didn't provide an external one)
Step 4: Verify
Visit http://your-server:3000 and complete the initial setup wizard. You should see the dashboard with zero pieces — ready for your first deployment.
Production Considerations
- Use a reverse proxy like Caddy or Nginx for TLS termination
- Set up regular database backups
- Monitor with Prometheus and Grafana using the built-in metrics endpoint
- Configure resource limits for piece execution to prevent noisy neighbours