# Point Vite HMR at localhost under Sail

> Sail on WSL2 needs the HMR host set to localhost. Do not remove the kit's Vite plugins to add that block.

- URL: https://laravel-vuejs.space/vite-hmr-sail-hostname
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Tooling

People searching “Vite HMR Sail” see the page and no updates when they save a Vue file. The browser on the host cannot reach the dev server’s advertised host inside Docker. The [Sail guide](https://laravel-vuejs.space/laravel-sail-vue) already has this block. The [Vite guide](https://laravel-vuejs.space/laravel-vite-vue) is the asset URL. This page is the hostname.

> **TL;DR**
>
> -   Sail on WSL2 needs the HMR host set to localhost.
> -   Do not remove the kit’s Vite plugins to add that block.
> -   Do not set the HMR host to a hostname that only resolves inside the container.
> -   Do not delete `public/hot` by hand while the dev server is running and expect it to stay gone.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```js
server: {
  hmr: {
    host: "localhost",
  },
},
```

Put it on the existing `defineConfig`. Leave the Laravel, Vue, and Tailwind plugins the kit generated. Restart `./vendor/bin/sail npm run dev`.

`public/hot` appears while that process is running. It must not be deployed. The [deploy guide](https://laravel-vuejs.space/deploy-laravel-vue) covers that file.

## What to avoid

> **Gotcha**
>
> Do not set the HMR host to a hostname that only resolves inside the container. The browser is the thing opening the socket. Do not delete `public/hot` by hand while the dev server is running and expect it to stay gone. The server writes it back.

## FAQ

**Q: How do I point Vite HMR at localhost under Sail?**

Sail on WSL2 needs the HMR host set to localhost. Do not remove the kit's Vite plugins to add that block.

**Q: What goes wrong with Vite HMR Sail?**

Many developers see the page and no updates when they save a Vue file. Do not set the HMR host to a hostname that only resolves inside the container.
