Prefect Self-Hosted

BeginnerData Pipeline

Self-hosted Prefect: Python-native pipeline orchestration with zero per-run cost.

Published 27 September 2026

Core Tools
Docker
Docker
Prefect
Prefect
Database
PostgreSQL
SQLite
Hosting
Hetzner
DigitalOcean
Hostinger
Amazon Web Services
Google Cloud Platform
Reverse Proxy
Traefik
Caddy
NGINX
Self-Hosted PaaS
Coolify
Dokploy

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

PostgreSQL

Prefect Self-Hosted with PostgreSQL

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.

SQLite

Prefect Self-Hosted with SQLite

The zero-setup default for single-server setups: one file beside the server and no database to run. It suits a team that will never scale past one machine; high availability, multiple server instances, and heavy event volume need PostgreSQL.

These are highlighted picks. To see all the tools, check the Databases category.

Hosting Options for Prefect Self-Hosted

Hetzner

Deploy Prefect Self-Hosted on Hetzner

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.

DigitalOcean

Deploy Prefect Self-Hosted on DigitalOcean

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.

Hostinger

Deploy Prefect Self-Hosted on Hostinger

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.

Amazon Web Services

Deploy Prefect Self-Hosted on Amazon Web Services

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.

Google Cloud Platform

Deploy Prefect Self-Hosted on Google Cloud Platform

The same placement on Google Cloud: a small Compute Engine instance or Cloud Run for the server at roughly $10-20/mo, Cloud SQL behind it, and workers pushing flow runs to Cloud Run jobs or GKE in the same network as the data.

These are highlighted picks. To see all the tools, check the Hosting & Cloud category.

Reverse Proxy Options for Prefect Self-Hosted

Traefik

Prefect Self-Hosted with Traefik

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.

Caddy

Prefect Self-Hosted with Caddy

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.

NGINX

Prefect Self-Hosted with NGINX

The conventional choice when a shared front door already terminates TLS on the host. Add the HTTP/1.1 upgrade headers for the events WebSocket, and remember that the proxy doesn't replace Prefect's own basic-auth setting if the API must be protected.

Self-Hosted PaaS Options for Prefect Self-Hosted

Coolify

Prefect Self-Hosted with Coolify

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.

Dokploy

Prefect Self-Hosted with Dokploy

Free and self-hosted, running the server container behind its bundled Traefik with HTTPS from the dashboard, and able to run workers as separate services on the same box. Scheduled backups cover the PostgreSQL service.

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.

Cloudflare Tunnel

Prefect Self-Hosted with Cloudflare Tunnel

An outbound-only connection keeps the server reachable from anywhere without inbound ports, the right shape for a home-lab orchestrator.

ngrok

Prefect Self-Hosted with ngrok

The same tunnel with a faster quick-start: fine for evaluation, tighter limits for a permanent server.

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.

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

DevOps & CI/CD

Data Engineering & ETL

Database (choose one)

Hosting (choose one)

Reverse Proxy or PaaS (choose one)

Reverse Proxy

Self-Hosted PaaS

Add-ons (optional — add any, or none)

Tunnel

Prefect Self-Hosted Pricing

From ~$6/mo Free to start

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.

Server (VPS or cloud)$5-12/mo

The server needs about 512 MB to 1 GB of RAM; 2 GB fits it with PostgreSQL. Flows run on workers, sized separately.

Prefect & PostgreSQLFree (open source)

Apache-licensed; RBAC, SSO, and audit logs are the Cloud-only features.

Exposure (reverse proxy or PaaS)Free (open source)

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.