Prefect Self-Hosted
BeginnerData PipelineSelf-hosted Prefect: Python-native pipeline orchestration with zero per-run cost.
Published 27 September 2026
About Prefect Self-Hosted
Prefect Self-Hosted runs the Prefect server on your own server with PostgreSQL behind it, alongside the workers that execute your flows. One Docker container and a database is the whole platform for a small team: the orchestration UI, the REST API, the scheduler, automations, and the event system that workers talk to.
Prefect's model is Python-first. @flow and @task decorate the functions you already have, with no new DSL to learn, and the same code runs locally and in production against the same server. Work pools target execution environments from Docker to Kubernetes, and deployments carry schedules and parameters so a run is one API call away.
Prefect Cloud adds RBAC, SSO, audit logs, webhooks, and managed serverless compute, on plans from free for 2 users to $100 per user a month. The self-hosted server shares the core, including automations, and protects the UI and API with a single shared basic-auth login; per-user access control is what eventually pushes larger teams to Cloud.
The trade is scope: you operate the server, the workers, and their upgrades yourself. SQLite works for a single-server setup and needs nothing at all; PostgreSQL (14.9 or newer with the pg_trgm extension) is the production choice and the default here, and splitting the server from its background services for high availability adds Redis as the event broker.
Key Features
- ✓Prefect server, UI, and REST API from one Docker deployment
- ✓PostgreSQL as the production metadata store, SQLite for single-server setups
- ✓Flows and tasks as decorated Python: no DSL, local runs match production
- ✓Work pools and workers for targeting execution environments
- ✓Deployments, schedules, and automations without a cloud account
When to Use Prefect Self-Hosted
- →Data teams scheduling Python pipelines without a per-run or per-seat bill
- →Engineers turning existing scripts into observable, retried workflows with decorators
- →ML teams orchestrating training and batch jobs across Docker or Kubernetes work pools
- →Organizations that must keep flow metadata and logs on their own infrastructure
- →Small teams replacing cron with scheduling, retries, and a UI
Pros
- The gentlest learning curve in the orchestrator family: no new DSL
- One container and a database is enough for a small team
- Usage-based cloud pricing avoided entirely
Cons
- RBAC, SSO, and audit logs are Cloud-only; the server has one shared basic-auth login
- You run the server and workers, including upgrades
- A smaller integration ecosystem than Airflow's provider catalog
Database Options for Prefect Self-Hosted
Prefect's production backend: version 14.9 or newer with the pg_trgm extension. It holds flows, runs, deployments, and the event history that automations read, and it's required for high availability and multi-server setups. Event retention defaults to 7 days, which keeps it small.
These are highlighted picks. To see all the tools, check the Databases category.
Hosting Options for Prefect Self-Hosted
The default: a flat-rate root VPS from around €4-5/mo whose entry instance has 4 GB, several times what the server and PostgreSQL need, so the same box can also run a worker for light flows. A fixed bill beats per-deployment Cloud pricing at any volume.
A root Droplet with snapshots and a cloud firewall in the panel: the 1 GB Droplet (about $6/mo) runs the server with SQLite, and 2 GB (about $12/mo) adds PostgreSQL. Managed PostgreSQL (from about $15/mo) is the low-ops home for the backend if you'd rather not run it.
The budget VPS in the list: the entry KVM plan (about $6.50/mo on a two-year term) has 4 GB of memory, room for the server, PostgreSQL, and a worker running light flows. Fewer regions than the larger providers, so place it near the data your flows move.
The server on a small EC2 instance or ECS task for roughly $10-20/mo, close to the compute your work pools target, with RDS as a managed home for the PostgreSQL backend. It earns its place when flows run on ECS, Batch, or EKS in the same VPC.
These are highlighted picks. To see all the tools, check the Hosting & Cloud category.
Reverse Proxy Options for Prefect Self-Hosted
Handles TLS and label-based routing in front of the server on port 4200. Set PREFECT_SERVER_UI_API_URL to the public HTTPS API address, or the UI in the browser calls the internal one, and let WebSocket connections through for the event stream workers use.
Automatic TLS from a short config, the lightest path to an HTTPS server for a small team. Caddy passes WebSocket upgrades by default, which Prefect's clients and workers use to stream events, so nothing extra is needed beyond the UI's public API URL.
Self-Hosted PaaS Options for Prefect Self-Hosted
Free and self-hosted, running the Prefect server image with PostgreSQL beside it and TLS from Coolify's bundled Traefik. Set the basic-auth string and the UI's public API URL in the service's environment before exposing it.
Prefect Self-Hosted Add-ons
Each addition below extends this stack with a capability the base stack works fine without. None are required: include the ones your product actually needs when building this stack, and skip the rest.
Tunnel Add-ons
Add a tunnel when you're self-hosting without a static IP or can't open inbound ports — a home server, a VPS behind restrictive network policies, or anywhere a reverse proxy alone can't reach the internet.
An outbound-only connection keeps the server reachable from anywhere without inbound ports, the right shape for a home-lab orchestrator.
Frequently Asked Questions about Prefect Self-Hosted
Why self-host Prefect instead of using Prefect Cloud?
Seats and deployments. Prefect Cloud's free Hobby plan covers 2 users and 5 deployments, Starter is $100/mo for 3 users and 20 deployments, and Team is $100 per user a month. The self-hosted server has no user or deployment limit and shares the core, including automations. What Cloud adds is per-user access control (RBAC and SSO), audit logs, webhooks, and managed serverless compute; the self-hosted server protects its UI and API with one shared basic-auth login.
What does the server need to run?
Very little, because flows don't run on it. Prefect's official Helm chart requests 512 MB of memory for the server and caps it at 1 GB, and maintainers measure the process at around 345 MB. A 1 GB server runs it with SQLite, and 2 GB adds PostgreSQL comfortably. Disk grows with event history, which Prefect keeps for 7 days by default, so 20 GB lasts a long time. Size workers separately, for the flows they run.
Where do my flow runs actually execute?
Not on the server. Prefect uses a hybrid model: this stack orchestrates, and the work runs wherever you point work pools and workers, whether the same machine, another VPS, or cloud compute next to the data. The server's job is schedules, state, events, and the UI; execution capacity is a separate decision.
SQLite or PostgreSQL, and when does Redis come in?
SQLite is Prefect's default and fine for a single server: zero setup and one file. PostgreSQL (14.9 or newer, with the pg_trgm extension) is the production choice and the default here. Redis enters only when you split the server from its background services or run several server instances for high availability: Prefect's Docker Compose guide adds it as the event broker for that layout, while a single server container keeps messaging in memory.
Is there a path to Prefect Cloud later?
Yes, and it's the same platform from the client's side: point PREFECT_API_URL at the Cloud workspace and re-point the workers. Flows, deployments, and work pools move as configuration, and what Cloud adds is RBAC, SSO, audit logs, and managed compute. Self-hosting first costs nothing later.
Stacks Related to Prefect Self-Hosted
Strapi Self-Hosted
InfrastructureSelf-hosted Strapi: an open-source headless CMS with PostgreSQL, on a server you control.
Airflow Self-Hosted
InfrastructureSelf-hosted Apache Airflow: the standard data-pipeline scheduler on your infrastructure.
n8n Self-Hosted
InfrastructureSelf-hosted n8n on your own server, with full control over the database, the host, and how it's exposed to the internet.
GitLab Self-Hosted
InfrastructureSelf-hosted GitLab with Docker: your code, your CI, your infrastructure.
Scores
Popularity3/5
A well-known Airflow alternative among Python data teams, with a smaller community than Airflow's.
Learning Curve2/5
Decorators on existing Python functions make the first flow quick, and the server is one container plus a database.
Flexibility4/5
Any Python can be a flow, and work pools send runs to Docker, Kubernetes, or cloud compute, with automations reacting to events.
Performance3/5
The server is light because work runs elsewhere; scaling means more workers, and high availability means PostgreSQL plus Redis.
Portability5/5
Flows are plain Python that run the same against a self-hosted server or Prefect Cloud, moved by changing one API URL.
Tools in the Prefect Self-Hosted Stack
Prefect Self-Hosted Pricing
The server and PostgreSQL are free, and the smallest instance tier runs them for a small team. The Cloud plans this replaces price by users and deployments: free for 2 users and 5 deployments, $100/mo for 3 users on Starter, and $100 per user a month on Team.
The server needs about 512 MB to 1 GB of RAM; 2 GB fits it with PostgreSQL. Flows run on workers, sized separately.
Apache-licensed; RBAC, SSO, and audit logs are the Cloud-only features.
Traefik, Caddy, NGINX, Coolify, and Dokploy all self-host free, with free Let's Encrypt certificates.
Prefect Self-Hosted System Requirements
- CPU
- 1 vCPU
- RAM
- 1 GB; the official Helm chart requests 512 MB and caps the server at 1 Gi
- Disk
- 20 GB SSD; trimming event retention (7 days by default) slows database growth
- OS
- Any Linux with Docker
No official requirements published — tekyous guidance based on the bundle's services.
The official Helm chart encodes working defaults (512 Mi request, 1 Gi limit) and maintainers measure the server process at roughly 345 MB; flow runs execute on workers elsewhere, so the box carries only the server and PostgreSQL.