Port 5173

What’s running on port 5173 on my Mac?

5173 is Vite’s default port (5-1-7-3 loosely spells V-I-T-E). React, Vue, Svelte and Solid projects all start there, so several of them fighting over it is normal.

Commonly used by

  • Vitevite / npm run dev serves on localhost:5173, and moves to 5174+ if busy.
  • SvelteKitvite dev under the hood, same port.
  • Vue (create-vue), React, Solid, Preact templatesAnything scaffolded with npm create vite uses 5173.
  • Vite previewvite preview uses 4173 instead, so it doesn’t clash with dev.

Check what’s on port 5173

lsof -nP -iTCP:5173 -sTCP:LISTEN

It’s node. Every Vite project looks the same here, so check the folder:

lsof -a -p <PID> -d cwd -Fn | tail -1

Vite drifts upward when its port is taken, so look at the range too:

lsof -nP -iTCP:5173-5180 -sTCP:LISTEN

With Stat Space: statspace port 5173.

Free it

kill <PID> stops it cleanly. If several Node processes are piling up and their parent is 1, their terminals are long gone; see finding orphaned Node processes.

Change the port

vite --port 5200
npm run dev -- --port 5200

Note the extra -- with npm, which passes the flag through to Vite. To make it permanent, edit vite.config.ts:

export default defineConfig({
  server: {
    port: 5200,
    strictPort: true,
  },
});

For SvelteKit, the same server block goes in vite.config.ts, not svelte.config.js. Tauri projects pin Vite to 1420 instead, and Astro uses 4321.

Who can reach it

Vite binds to localhost by default. --host or server.host: true listens on all interfaces, and Vite prints a Network URL. With that on, anyone on your Wi-Fi can load your source files directly, because the dev server serves untransformed modules and source maps. Vite restricts which files it will serve outside the project root, but treat any exposed dev server as public. See dev server exposed to the network.

Seeing it live

Stat Space shows every Vite server on 5173 and above with its project folder, launcher and uptime, so the three copies of the same app are obvious. A --host server gets an exposure warning, and the row offers a QR code for opening it on your phone.

Questions

Why is my Vite app on 5174 or 5175?

Earlier Vite servers are still running on the lower ports. Run lsof -nP -iTCP:5173-5180 -sTCP:LISTEN to see them all, and stop the ones you don't need.

How do I make Vite fail instead of switching ports?

Set server: { port: 5173, strictPort: true } in vite.config, or run vite --port 5173 --strictPort. Useful when an OAuth callback or proxy expects one exact port.

How do I open the Vite dev server on my phone?

Run vite --host and open the Network URL it prints. By default Vite only listens on localhost.

Get started

Know what your Mac is doing, without adding to it.

Free, no account. Pro is $9.99 once for the first 100 buyers.