← All docs

How do I run Next.js, Vite, or other JS dev servers on my VM?

The exe.dev HTTPS proxy makes requests to https://my-vm.exe.xyz/ work to talk to your VM. To allow Vite and Next.js to work, you need to add your VM hostname to the framework's origin allow-list.

Next.js

Next.js ≥ 15.2 uses allowedDevOrigins:

// next.config.js
module.exports = {
  allowedDevOrigins: [
    'my-vm.exe.xyz',
    'my-vm.exe.xyz:8000', // and any other ports in 3000–9999 you use
  ],
};
npx next dev -H 0.0.0.0 -p 8000

See allowedDevOrigins.

Vite

Vite ≥ 5.0 uses server.allowedHosts:

// vite.config.js
import { defineConfig } from 'vite';

export default defineConfig({
  server: {
    host: '0.0.0.0',
    port: 5173,
    allowedHosts: ['my-vm.exe.xyz'],
  },
});

See server.allowedHosts.