Cullen Baker
09/23/2025, 10:09 PMMarvin
09/23/2025, 10:10 PMMarvin
09/23/2025, 10:12 PMprefect server start --host 0.0.0.0 --port 4200
- Make sure your OS firewall allows inbound traffic on that port.
- Share your machine’s IP and port with your teammates (e.g., http://YOUR-IP:4200).
- Note: This serves both the API and the UI on the same host:port.
More secure (SSH tunnel, no network exposure)
- Keep the server bound to localhost:
prefect server start --host 127.0.0.1 --port 4200
- Each teammate creates a tunnel from their machine:
ssh -N -L 4200:localhost:4200 user@YOUR-HOST
- They visit http://localhost:4200 on their machine.
Internet exposure (production-ish)
- Don’t expose Prefect directly to the internet; put it behind a reverse proxy with TLS and authentication (e.g., Nginx, Caddy, or Traefik).
- You may need to set PREFECT_API_URL
(for API consumers like workers) and ensure the UI can reach the API via the same origin or a configured URL if you’re using a path prefix/reverse proxy.
- Docs and examples:
- Self-hosting the Prefect API and UI
- Security considerations and settings
- Example with reverse proxy: Reverse proxy example
Consider Prefect Cloud (easiest sharing + auth)
- If you want a hosted, shared UI with built-in auth and secure access, Prefect Cloud is the simplest path. You’d run your flows anywhere and connect to Cloud for the UI/API.
Important notes
- The local server has no built-in auth. Anyone who can reach it can use the UI and API, so prefer SSH tunneling, VPN, or a reverse proxy with TLS + auth for anything beyond a trusted LAN.
- If you’re running in Docker, remember to publish the port (e.g., -p 4200:4200
) and still bind the server to 0.0.0.0
inside the container.
Would you like to share on your local network only, or make it accessible over the internet? I can tailor steps (and example configs) based on that.Cullen Baker
09/23/2025, 10:19 PMCullen Baker
09/23/2025, 10:20 PMMarvin
09/23/2025, 10:20 PMresearch_prefect_topic
📊 Tools used:
• check_cli_command
(1x)
• research_prefect_topic
(1x)Cullen Baker
09/23/2025, 10:34 PMMarvin
09/23/2025, 10:34 PMMarvin
09/23/2025, 10:36 PM0.0.0.0
(and especially 0.0.0
) is a “bind” address the server uses to listen on all interfaces — it’s not a valid address for clients to call. Point your client at a concrete address instead.
Quick fixes by scenario:
- Local server + local client (same machine):
- Use <http://127.0.0.1:4200/api>
or <http://localhost:4200/api>
- Update your config:
prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
- Local server in Docker, client on the host:
- Start/bind the server and publish the port:
prefect server start --host 0.0.0.0 --port 4200
If running the server in a Docker container, ensure the container maps the port:
docker run -p 4200:4200 your-server-image
- Client URL: <http://127.0.0.1:4200/api>
- Server in Docker and client in another container:
- Put both containers on the same user-defined Docker network and use the server container’s name:
http://<server-container-name>:4200/api
- Server on a remote VM:
- Start the server binding to all interfaces:
prefect server start --host 0.0.0.0 --port 4200
- Open firewall/security group for port 4200.
- Client URL: http://<vm-public-ip-or-dns>:4200/api
How to inspect and correct your Prefect config (Prefect 3.x):
- View current settings and sources:
prefect config view --show-sources
If you see PREFECT_API_URL=<http://0.0.0.0:4200/api>
(or `http://0.0.0:4200/api`), change it:
prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
- You can also set it via environment variables:
- macOS/Linux:
export PREFECT_API_URL=<http://127.0.0.1:4200/api>
- PowerShell:
$env:PREFECT_API_URL = "<http://127.0.0.1:4200/api>"
Useful references:
- Manage settings: Manage settings
- Self-hosted server (Docker): Run Prefect Server with Docker
- Helm/Kubernetes: Helm install for Prefect Server
A couple of checks:
- Make sure the server is actually running and reachable in a browser at the right host: http://127.0.0.1:4200 locally, or your VM’s IP/DNS if remote.
- The API must always be a concrete, routable address for the client (never 0.0.0.0
).
If you can share a bit more about your setup, I can tailor the exact URL and commands:
- Where is the Prefect Server running (your laptop, a container, a remote VM)?
- From where is your code/worker/agent trying to connect?
- How are you starting the server right now?