Aaron
11/07/2025, 5:14 PMMarvin
11/07/2025, 5:14 PMMarvin
11/07/2025, 5:18 PMprefect server start runs a single server that serves both the UI and API on the same port (by default 127.0.0.1:4200). The UI should talk to the API at http://127.0.0.1:4200/api. Your UI is trying http://localhost:4201/api, which suggests an env/config override.
Quick fix
- Start the server with an explicit UI API URL:
export PREFECT_SERVER_UI_API_URL=<http://127.0.0.1:4200/api>
prefect server start
Then refresh http://127.0.0.1:4200/dashboard.
Or, if you actually want to use port 4201, run the server on 4201 and open that port in the browser:
prefect server start --port 4201
Then visit http://127.0.0.1:4201/dashboard.
Diagnose what set 4201
- See where settings are coming from:
prefect config view --show-sources
Look for:
- PREFECT_SERVER_UI_API_URL
- PREFECT_SERVER_API_PORT
- PREFECT_API_URL (client setting; won’t affect the UI, but good to keep consistent)
- Test API health directly:
curl -s <http://127.0.0.1:4200/api>
curl -i <http://127.0.0.1:4200/api/ready>
- Check for port conflicts on macOS:
lsof -nP -iTCP:4200 -sTCP:LISTEN
Common causes
- An existing env var or profile set PREFECT_SERVER_UI_API_URL=<http://localhost:4201/api>
- A prior run with --port 4201 but you’re visiting 4200
- Port 4200 is in use, so the server failed to bind there
Docs for reference
- Server CLI: prefect server start
- Settings reference: Settings
- Health endpoints: /api health and /api/ready
If this doesn’t resolve it, could you share:
- Your prefect version
- The relevant lines from prefect config view --show-sources that include any PREFECT_SERVER_* or PREFECT_API_* entries
- The output of curl <http://127.0.0.1:4200/api>?