Skip to main content
You can use Helm to manage a self-hosted Prefect server and a worker.

Prerequisites

  • A Kubernetes cluster
  • Install the Helm CLI

Deploy a server with Helm

Configuring ingress or publicly exposing Prefect from the cluster is business dependent and not covered in this tutorial. For details on Ingress configuration, consult the Kubernetes documentation.

Add the Prefect Helm repository:

helm repo add prefect https://prefecthq.github.io/prefect-helm helm repo update 

Create a namespace

Create a new namespace for this tutorial (all commands will use this namespace):
kubectl create namespace prefect kubectl config set-context --current --namespace=prefect 

Deploy the server

Expected output:
NAME: prefect-server LAST DEPLOYED: Tue Mar 4 09:08:07 2025 NAMESPACE: prefect STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Run the following command to port-forward the UI to your localhost: $ kubectl --namespace prefect port-forward svc/prefect-server 4200:4200  Visit http://localhost:4200 to use Prefect! 

Access the Prefect UI:

kubectl --namespace prefect port-forward svc/prefect-server 4200:4200 
Open localhost:4200 in your browser. If using basic authentication, sign in with admin:password123.

Deploy a worker with Helm

To connect a worker to your self-hosted Prefect server in the same cluster: Expected output:
Release "prefect-worker" has been installed. Happy Helming! NAME: prefect-worker LAST DEPLOYED: Tue Mar 4 11:26:21 2025 NAMESPACE: prefect STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: 

Cleanup

To uninstall the self-hosted Prefect server and Prefect worker:
helm uninstall prefect-worker helm uninstall prefect-server 

Troubleshooting