Hi <@ULVA73B9P>, I am currently running prefect 3 ...
# ask-marvin
c
Hi @Marvin, I am currently running prefect 3 self hosted. I am running on two differnt VMs on the same virtual network. completely differnt machines. i am accessing the netowrk via vpn. both are on port 4200, but differnt machines. if i visit the dashbaord for one of them, it takes me to the others dashbaord. it seems like it it treating the ports as conflicting.
m
thought for 367.4 seconds
Thanks for the details — this sounds like the UI is pointing at the wrong API between your two servers, not a pure “port conflict”. In Prefect 3.x, the UI reads its API target from each server’s /ui-settings endpoint. If both servers return the same API URL, your browser will show the UI from one host but load data from the other — which looks like it “takes you to the other dashboard”. Quick checks - How are you accessing each instance? Different hostnames/IPs (e.g., 10.0.0.5:4200 and 10.0.0.6:4200), or via the same hostname behind a VPN/proxy? - On each VM, visit its own /ui-settings and compare api_url:
Copy code
curl -s http://<hostA>:4200/ui-settings
  curl -s http://<hostB>:4200/ui-settings
The api_url values should point to their own host:port (and be different from each other). - On each VM, confirm the effective setting:
Copy code
prefect config view --show-sources | grep PREFECT_UI_API_URL
If this isn’t set, the server derives it and you can end up with an unexpected or shared value. How to fix - Explicitly set a unique PREFECT_UI_API_URL for each instance (to itself), then restart the server:
Copy code
# On VM A
  export PREFECT_UI_API_URL="http://<hostA>:4200/api"
  prefect server start

  # On VM B
  export PREFECT_UI_API_URL="http://<hostB>:4200/api"
  prefect server start
You can also set PREFECT_SERVER_API_HOST/PORT if needed, but PREFECT_UI_API_URL is the critical one for the UI. - After restarting, re-check:
Copy code
curl -s http://<hostA>:4200/ui-settings
  curl -s http://<hostB>:4200/ui-settings
Ensure each api_url reflects its own host. - In your browser, hard refresh both origins and clear site data for each host:port to avoid cached API targets (localStorage/cache). If you’re behind a reverse proxy - If both instances sit behind the same hostname, give them different subdomains or distinct paths and configure accordingly: - Different domains: - Instance A: set PREFECT_UI_API_URL="https://dash-a.example.com/api" - Instance B: set PREFECT_UI_API_URL="https://dash-b.example.com/api" - Different paths: - Proxy /a/ → server A, /b/ → server B - Then set on A:
PREFECT_UI_SERVE_BASE="/a/"
and
PREFECT_UI_API_URL="/a/api"
- On B:
PREFECT_UI_SERVE_BASE="/b/"
and
PREFECT_UI_API_URL="/b/api"
Useful commands (verified) - View current settings:
Copy code
prefect config view --show-sources
- Start the server:
Copy code
prefect server start --help
If you can share how you’re accessing each (exact URLs/hostnames) and the outputs of the two /ui-settings calls, I can confirm the exact tweak needed.
c
what should i use for the server service [Unit] Description=Prefect Server After=network.target [Service] User=aspire EnvironmentFile=/home/aspire/actions-runner/_work/data-pipeline/data-pipeline/.env # Ensure Prefect knows its own API URL to avoid interactive prompt Environment=PREFECT_API_URL WorkingDirectory=/home/aspire/actions-runner/_work/data-pipeline/data-pipeline ExecStart=/home/aspire/prefect-venv/bin/prefect server start --host 0.0.0.0 --port 4200 Restart=on-failure [Install] WantedBy=multi-user.target