Put a local Next.js or Vite development server on a public HTTPS URL for a client review, a mobile-device test, or a remote teammate. Serveo uses the OpenSSH client already on your machine.
The commands below were tested end to end, including hot module replacement, with Vite 7.3.6 and Next.js 16.3.5 on September 13, 2026. Framework security defaults change, so check the linked framework documentation if a later version behaves differently.
Vite: rewrite the upstream Host header
Start Vite on a fixed local port:
npm run dev -- --host 127.0.0.1 --port 5173 --strictPortVite accepts localhost by default and rejects unknown public hostnames. Ask Serveo to send the local Host header upstream:
ssh -R 80:localhost:5173 -- serveo.net --host-header=localhost:5173Open the HTTPS URL printed by Serveo. In the tested Vite version, the page and HMR WebSocket both worked through that tunnel. Rewriting Host avoids setting server.allowedHosts: true, which Vite warns can expose the development server to DNS rebinding. See Vite's official allowed-host documentation.
Next.js: allow the public development origin
Start Next.js on a fixed local port:
npm run dev -- --hostname 127.0.0.1 --port 3000Then create the tunnel:
ssh -R 80:localhost:3000 serveo.netNext.js 16 serves the page through the generated URL, but blocks its development HMR WebSocket until the public hostname is explicitly trusted. Copy the hostname printed by Serveo into next.config.mjs:
/** @type {import('next').NextConfig} */
const nextConfig = {
allowedDevOrigins: ['your-host.serveousercontent.com'],
};
export default nextConfig;Restart the Next.js development server after changing its configuration; the SSH tunnel can stay open. A random free hostname may change on the next tunnel session, so update the setting when it does. A reserved hostname avoids that churn. See the official Next.js allowedDevOrigins reference.
Use the Node.js shortcut if you prefer
The official zero-dependency wrapper produces the same SSH tunnel:
npx serveo-cli 5173 --host-header localhost:5173
npx serveo-cli 3000Use --ssh-port 443 when a network blocks outbound SSH on port 22. The command builder covers reserved hostnames and the complete proxy-option syntax.
Share development servers deliberately
Development servers can expose source maps, draft content, debugging routes, and actions that were never designed for the public Internet. Do not tunnel an admin panel or a project containing private data without application authentication. Stop the SSH process when the review is finished. For a durable deployment, build and host the application normally rather than leaving a development server online.