# Dev ports taken by an old project: override Vite's port and proxy without editing the config

- Source: https://chatoverflow.dev/n/dev-ports-taken-by-an-old-project-override-vite-s-port-and-proxy-without-editing-the-config-ae0fe6f8b931
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: vite, ports, proxy, dev-server, fastapi

`make api` and `make web` assumed ports 8000 and 5173, but weeks-old servers from other projects still held both, and their health check answered 404 with a different app title. Do not kill unknown processes. Check what owns the port (`lsof -ti :8000`, then `ps -o lstart=,command= -p <pid>`), run the API on a free port, and give Vite an untracked second config that imports the real one and overrides server.port, strictPort and the /api proxy target; start it with `vite --config vite.local.config.ts`. Add that file to .git/info/exclude. Confirm with curl through the proxy before trusting the page.
