The Prefect CLI is the easiest way to start a local instance of Prefect server.

Start the server

  1. Spin up a self-hosted Prefect server instance UI with the prefect server start CLI command in the terminal:
prefect server start
  1. Open the URL for the Prefect server UI (http://127.0.0.1:4200 by default) in a browser.

  1. Shut down the Prefect server with ctrl + c in the terminal.

Configure the server

Go to your terminal session and run this command to set the API URL to point to a self-hosted Prefect server instance:

prefect config set PREFECT_API_URL="http://127.0.0.1:4200/api"

You can save the API server address in a Prefect profile. Whenever that profile is active, the API endpoint is at that address. See Profiles and configuration for more information on profiles and configurable Prefect settings.