localhost:5173
The address of the Vite development server on your own computer. React, Vue, Svelte and SvelteKit projects built with Vite all start on port 5173.
Updated November 2026 · 3 min read
-
Written by
Andrian Valeanu
Founder of Pulsetic
-
Reviewed by
Ionut Caval
Technical reviewer
The short version: http://localhost:5173 works only while npm run dev is running in your project. If the page will not load, the dev server stopped, or Vite found 5173 busy and moved to 5174. The terminal prints the real address on the line that starts with Local:.
- Used by
- Vite, and the React, Vue, Svelte and SvelteKit projects built on it
- Full address
http://localhost:5173- If the port is busy
- Vite moves to 5174, then 5175
- Most common problem
- The dev server is not running
What is localhost:5173?
localhost:5173 is the Vite development server on your own computer. Vite is the build tool behind most new React, Vue and Svelte projects, and 5173 is its default port. The number is a play on the name: 5 is the Roman numeral V, and 1, 7 and 3 stand in for I, T and E.
Older projects used port 3000. Vite changed its default to 5173 in version 3, partly because so many other tools already wanted 3000.
The dev server is for writing code. It rebuilds on every save and is not meant to serve real visitors. vite preview, which serves the finished build for a last check, uses port 4173.
What runs on port 5173
All of these start a Vite dev server on 5173. The last column shows how to move each one to a different port.
| Program | How it starts | Change the port |
|---|---|---|
| Vite (any template) | npm run dev | npm run dev -- --port 3000, or server.port in vite.config.js |
| Vue (create-vue) | npm run dev | Same as Vite |
| React with Vite | npm run dev | Same as Vite |
| SvelteKit | npm run dev | npm run dev -- --port 3000 |
| Vite preview | npm run preview (port 4173) | preview.port in vite.config.js |
Why localhost:5173 will not load
- The dev server is not running. The browser shows "localhost refused to connect". The terminal was closed, or
npm run devended with an error. - Vite moved to another port. When 5173 is busy, usually because an earlier
npm run devis still running, Vite starts on 5174 without asking. Your bookmark for 5173 then shows the old project, or nothing. - You are opening it from another device. Vite listens only on localhost by default. A phone or a second computer cannot connect until you start it with
--host. - It runs in Docker or WSL. Inside a container Vite must listen on all interfaces (
--host), and the port must be published with-p 5173:5173. - A blank page, not an error. The server is fine and the app failed in the browser. Open the developer console: the cause is a JavaScript error, not the port.
- You typed https. The dev server uses plain HTTP unless you configure a certificate.
Find what is using port 5173
One command shows whether a program is listening on the port, and which one. No output means nothing is listening, and that is exactly when the browser says the connection was refused.
On Linux, ss -ltnp | grep :5173 gives the same answer. Add sudo on macOS or Linux to see programs owned by another user. Stopping a process ends whatever it was doing, so check what it is before you stop it.
How to fix it
If the page will not load
- Run
npm run devin the project folder and leave that terminal open. - Open the address on the
Local:line. If it says 5174, an older server still holds 5173. - For another device, run
npm run dev -- --hostand use theNetwork:address Vite prints. - If the page is blank, check the browser console for errors.
If you need the port to stay the same
- Stop the stale server: find it with the commands in the section above and end the process.
- Set
server.strictPort: trueinvite.config.js. Vite then exits with an error when the port is busy and no longer switches silently. - Set
server.portif a login callback or an API allow-list expects a specific port.
From localhost to production
The dev server never goes to production. You run vite build, and the files it writes are served by a web server or a hosting platform on ports 80 and 443. From then on, what matters is whether that public address answers, not whether port 5173 does.
To test a deployed address by hand, the free bulk URL status checker shows the status code and redirects for a list of URLs, and Is Website Down checks one from several countries. Neither can see localhost: like any service on the internet, they only reach public addresses.
Deployed it? Watch the public URL.
Pulsetic is website uptime monitoring. It cannot reach localhost, but once your app is live it checks the public URL from outside your network, confirms any failure from another region, then emails you.
10 monitors free, checked every 5 minutes, with email alerts on failure and recovery. No credit card.
Sources and further reading
The documentation and specifications this guide is written from.
Frequently asked questions
-
Why is Vite on port 5173?
It is the default since Vite 3. The digits spell VITE: 5 is the Roman numeral V, and 1, 7 and 3 look like I, T and E. Before version 3 the default was 3000.
-
Why did my app open on 5174 and not 5173?
Port 5173 was already in use, most often by another
npm run devyou left running. Vite tries the next port up. Stop the other server, or setstrictPort: trueto make Vite fail and tell you. -
How do I change the Vite port?
Pass it on the command line with
npm run dev -- --port 3000, or setserver: { port: 3000 }invite.config.js. -
How do I open localhost:5173 on my phone?
Start the server with
npm run dev -- --host, keep the phone on the same Wi-Fi, and open theNetwork:address Vite prints, which uses your computer's local IP address.
-
Know when your live website stops answering.
2-minute setup · Cancel any time
-
No credit card needed