Skip to content
Home

Guide

Share localhost online, securely

Need someone to see the app running on your computer — a client, a teammate, your phone? Localians gives your local dev server a secure HTTPS link with one command. No deploy, no port forwarding.

Share your local app in three steps

  1. Start your app as usual — for example npm run dev — and note the port it prints.
  2. Run one command with that port:
$ npx localians share 3000
  1. Approve this computer once. The first time, your browser opens so you can connect the CLI to your Localians account. Then the command prints your link, like https://k3v9qz2mx7ta.preview.localians.com.

Send the link. Whoever opens it sees your app, live: your edits show up as you make them, with hot reload over WebSockets (Next.js needs one setting).

Keep previews private

  • Password protection. Turn it on for a project and visitors enter a password before they reach your app. Changing the password signs everyone out immediately.
  • Unguessable links. Every share gets a new random address, so old links stop working.
  • Stop any time. Press Ctrl+C in the terminal, or stop the preview from the dashboard — the link stops right away.
  • Don't share secrets. A preview is your development app; avoid real customer data and production credentials.

Details: how preview security works.

How localhost tunneling works

The Localians CLI opens an outgoing TLS connection from your computer to the Localians gateway. When someone opens your link, the gateway sends the request through that connection, and the CLI forwards it to localhost on the port you chose — never to any other address or port. Responses travel back the same way, including WebSockets.

By default your app sees requests addressed to localhost:<port>, which keeps dev servers' host checks happy. The original address is passed in the standard X-Forwarded-Host and X-Forwarded-Proto headers.

Works with your stack

Anything that serves HTTP on a local port can be shared. Framework-specific notes:

The CLI runs on Windows, macOS and Linux with Node.js 20 or newer. Coming from another tool? See Localians as an ngrok alternative.

Questions

Is it safe to expose localhost to the internet?

Only the one port you choose is reachable, and only while the share command runs. Visitors get an HTTPS link; nothing else on your computer or network is exposed. For anything sensitive, turn on password protection and stop sharing when you're done.

Do the people I share with need an account?

No. They open the link in any browser. If the preview is password protected, they enter the password you gave them.

Does my computer have to stay on?

Yes. Localians forwards visitors to the app running on your machine; it doesn't host a copy. If your computer sleeps or the dev server stops, visitors see that the preview is offline.

Do I need to change my router, firewall or DNS?

No. The CLI makes an outgoing, encrypted connection to Localians, so it works behind home routers, office firewalls and NAT without opening ports.

Can I choose the link's name?

Each share gets a random, hard-to-guess address on preview.localians.com. A reserved custom URL that stays the same every time you share comes with the 7-Day Preview Pass.

Share your first preview in about a minute.

Free to start with a 24-hour preview per project. No credit card, nothing to deploy.