Janet Carson
05/29/2026, 7:35 PMMarvin
05/29/2026, 7:35 PMMarvin
05/29/2026, 7:37 PMprefect.yaml.
For Prefect 3.x, PREFECT_WORKER_WEBSERVER_PORT is a runtime setting for the worker process. That means it’s read from Prefect’s settings system when the worker starts, not from deployment config in prefect.yaml.
You have a few valid options:
Environment variable
bash
export PREFECT_WORKER_WEBSERVER_PORT=9090
prefect worker start --pool my-pool --with-healthcheck
Project prefect.toml
toml
[worker.webserver]
port = 9090
Also supported:
- .env
- active Prefect profile via prefect config set
- pyproject.toml
Important distinction:
- prefect.yaml = deployment/project orchestration config
- PREFECT_WORKER_WEBSERVER_PORT = worker process setting
So if you're asking whether it must be in the shell script/environment that starts the worker: not necessarily. It can live in prefect.toml instead. But it does need to be available through Prefect settings at worker startup.
Relevant docs:
- Settings reference
- Workers
If you want, I can also show exactly how prefect.yaml and prefect.toml should coexist in the same project.