port 5173 · vite dev server

localhost:5173

Port 5173 is where the Vite dev server listens by default. It lives on your own machine, not on the internet. If you got here by typing localhost5173 into the address bar, this is the link you actually wanted:

Only opens if a dev server is running on this device right now. Remove the autocomplete that sent you here →

~/your-project — npm run dev
$ npm run dev

  VITE v8.2.2  ready in 312 ms

    Local:   http://localhost:5173/
    Network: use --host to expose
    press h + enter to show help

# troubleshooting

Why localhost:5173 is not opening

Eight things that go wrong, from the most common down. Each one with the command that fixes it.

  1. ERR_CONNECTION_REFUSED — “This site can’t be reached”

    Nothing is listening on 5173. Nine times out of ten the dev server is simply not running.

    bash
    cd your-project
    npm install
    npm run dev
  2. You typed localhost5173 and landed here

    Without the colon the browser treats it as a search term, so a search engine answered instead of your machine. The address needs the colon.

    address bar
    http://localhost:5173
  3. “Port 5173 is in use, trying another one…”

    Another dev server — usually one you forgot to stop — holds the port, so Vite quietly moves to 5174, 5175, and so on. Either open the port it printed, or free 5173.

    bash
    # macOS / Linux
    kill -9 $(lsof -ti:5173)
    
    # Windows
    netstat -ano | findstr :5173
    taskkill /PID <pid> /F
    
    # either
    npx kill-port 5173
  4. Works on your laptop, not on your phone

    localhost always means “this device”. On the phone it points at the phone, where nothing is running. Expose the server and open the Network URL Vite prints.

    bash
    npm run dev -- --host
    # ➜ Network: http://192.168.x.x:5173/
  5. Dead inside Docker, WSL or a codespace

    The server binds to 127.0.0.1 inside the container, which the host cannot see. Bind to every interface and publish the port.

    bash
    vite --host 0.0.0.0
    docker run -p 5173:5173 my-image
  6. https://localhost:5173 does not load

    The dev server speaks plain HTTP. The s makes the browser wait for a TLS handshake that never comes. Drop it, or add a dev certificate.

    address bar
    http://localhost:5173
    # TLS in dev:
    npm i -D @vitejs/plugin-basic-ssl
  7. You want a port other than 5173

    Two projects fighting over one port, a firewall rule, a proxy expecting something fixed. strictPort makes Vite fail loudly instead of silently sliding to 5174.

    vite.config.js
    // vite.config.js
    export default defineConfig({
      server: { port: 3000, strictPort: true }
    })
    
    # or once:
    npm run dev -- --port 3000

# autocomplete

Get rid of the suggestion that sent you here

Once you have opened this domain, your browser remembers it and offers it the next time you type localhost. One keystroke removes the entry — the suggestion list is just your history.

  • Chrome, Edge, Brave, Arc

    Shift + Delete

    Start typing until the wrong entry appears, press ↓ to highlight it, then Shift + Delete. On a Mac keyboard without a Delete key: Shift + Fn + Backspace.

  • Firefox

    Shift + Delete

    Same handling: highlight the suggestion with ↓, then Shift + Delete removes it from the address bar history.

  • Safari

    via History

    Safari has no shortcut for a single suggestion. Open History (⌘ Y), search for localhost, select the entries and press Backspace.

  • Phones and tablets

    via History

    The suggestion is fed from your browsing history. Delete the localhost entries there and it stops appearing.

Afterwards, type the address with the colon — or better, bookmark it. The omnibox learns from what you actually pick.

address bar
# wrong — the browser searches for this
localhost5173

# right — the colon makes it an address
http://localhost:5173

# who uses port 5173

Vite — and everything built on it

Vite 3 made 5173 the default in 2022. Every framework that uses Vite for development inherited it, which is why the number shows up in so many terminals, tutorials and bug reports.

  • Vite

    Every template — vanilla, React, Vue, Svelte, Solid, Preact, Lit — starts here on npm run dev.

  • SvelteKit

    Built on Vite, so vite dev opens the same port.

  • React Router v7 / Remix

    Its Vite-powered dev server uses 5173 too.

  • Qwik

    Qwik City runs on Vite, and therefore on 5173.

  • Laravel + Vite

    The Vite plugin serves assets from 5173 while PHP answers on 8000.

  • A screenshot

    Tutorials, bug reports and screen recordings are full of localhost:5173 links. They only ever worked on the machine that recorded them.

# the neighbourhood

Default ports you will meet next to 5173

PortToolNote
5173Vite Default dev server port since Vite 3 (2022)Default dev server port since Vite 3 (2022)
5174+Vite, fallback Taken automatically when 5173 is busyTaken automatically when 5173 is busy
4173vite preview Serves the production build from dist/Serves the production build from dist/
3000Next.js · Nuxt · CRA Also the old Vite 2 defaultAlso the old Vite 2 default
8080Vue CLI · webpack-dev-server The classic pre-Vite front-end portThe classic pre-Vite front-end port
4200Angular CLI ng serveng serve
4321Astro Vite-based, but its own portVite-based, but its own port
6006Storybook Unchanged even with the Vite builderUnchanged even with the Vite builder
1420Tauri Runs its Vite server on a separate portRuns its Vite server on a separate port
8000Django · php artisan serve Backend half of many 5173 setupsBackend half of many 5173 setups

# trivia

Why 5173 of all numbers?

Vite 2 started on port 3000 — and so did Next.js, Nuxt, Create React App and roughly every Node backend ever written. Vite 3 moved out of that traffic jam in 2022 and picked something nobody else was using. Fewer collisions, fewer “port already in use” messages on the first run of the day.

The number itself has a second reading that the community likes better: 5173 spells SITE in leetspeak.

leetspeak
5  S
1  I
7  T
3  E

Take that part as folklore rather than documentation. The practical reason — getting away from the crowded 3000 — is the one that mattered.

# faq

Questions about port 5173

What is localhost:5173?

It is the address of a Vite development server running on your own computer. localhost points at your machine, 5173 is the port Vite listens on by default. It is not a public website — it exists only while a dev server is running on that one device.

Why does localhost:5173 refuse to connect?

Because nothing is listening on that port. Run npm run dev inside your project folder and open the URL the terminal prints. If Vite reports that 5173 is in use, it has moved to 5174 or higher.

Which programs use port 5173?

Vite and everything built on it: SvelteKit, React Router v7 (formerly Remix), Qwik, the Laravel Vite plugin, and every Vite starter template for React, Vue, Svelte, Solid, Preact or vanilla JavaScript.

Is localhost:5173 safe?

Yes. Traffic to localhost never leaves your computer. It becomes reachable for others only if you start the server with --host on a shared network or open a tunnel to it deliberately.

Why 5173 and not 3000?

Vite 3 moved the default off 3000 in 2022 because that port was already crowded by Next.js, Nuxt, Create React App and countless Node backends. A rarely used port means fewer collisions. The number also reads as SITE in leetspeak — 5=S, 1=I, 7=T, 3=E — which is how the community likes to explain it.

What is the difference between 5173 and 4173?

5173 serves your source files with hot module replacement while you develop. 4173 is what vite preview uses to serve the built bundle from dist/, so you can check the real production output before deploying.

Can I open someone else’s localhost:5173?

No. The name resolves to 127.0.0.1 on whatever device you open it on, so you always reach your own machine. Sharing a running dev server needs a tunnel such as cloudflared or localtunnel, or a deployed preview URL.

Is this site affiliated with Vite?

No. localhost-5173.com is an independent explainer for a port number. Vite is an open source project maintained by VoidZero and its contributors; the official documentation lives at vite.dev.