All articles
A developer sharing a public link to a local dev server with collaborators around the globe.
local developmentcollaborationdemoslocalhost tunneling

Share Your Local Dev Server Publicly

You can share your local dev server with anyone on the internet by exposing it through a public HTTPS URL. A localhost tunnel turns your in-progress work into a live preview link in seconds—no staging deploy, no VPN, and no screen sharing required.

Why share localhost instead of deploying to staging?

Staging deploys work for final integration checks, but they are slow for everyday collaboration. When a designer needs to review a UI tweak, a PM wants to test a new flow, or a client asks for a demo, waiting for CI/CD pipelines adds unnecessary friction.

Localhost tunneling gives you instant feedback loops: change code locally, refresh the shared URL, and collaborators see the update immediately.

Who benefits from shared local previews?

  • Designers: review responsive layouts and interactions on real URLs.
  • Product managers: validate feature flows before code review merges.
  • QA engineers: test edge cases on the developer's exact branch.
  • Clients and stakeholders: see work-in-progress without accessing your internal infrastructure.
  • Remote teammates: collaborate across time zones without shared VPN access.

How to share your local dev server in one command

  1. Start your application locally (for example on port 3000).
  2. Run npx portpreview 3000 to create a public HTTPS URL.
  3. Copy the URL and send it to your collaborator via Slack, email, or your project tool.
  4. They open the link in any browser—no special software required.
  5. Keep the tunnel running while the review session is active, then stop it when done.

Best practices for sharing local previews

Use test data, not production

Shared previews should use sandbox credentials and anonymized test data. Never expose production databases or real customer information through a development tunnel.

Set expectations about uptime

Tunnel URLs are active only while your CLI session runs. Tell collaborators the link expires when you close your laptop or stop the tunnel.

Test on real devices

Shared URLs work on phones and tablets too. For mobile-specific reviews, see our guide on mobile testing with a localhost tunnel.

Protect sensitive features

If your preview includes admin panels or unreleased features, add basic auth or feature flags rather than sharing an unprotected tunnel URL broadly.

Local preview vs staging vs screen sharing

  • Screen sharing: fast but passive—reviewers cannot interact independently.
  • Staging deploy: realistic environment but slow iteration (minutes to hours).
  • Localhost tunnel: instant, interactive, and tied to your current branch.

Common use cases

Design review sessions, sprint demos, client walkthroughs, OAuth flow testing with external providers, and cross-browser QA all benefit from a shareable local URL. For OAuth-specific setup, read how to test OAuth callbacks locally.

Start PortPreview free to share local previews with built-in request visibility.

Frequently asked questions

How do I share my localhost with someone else?
Start a localhost tunnel with PortPreview to get a public HTTPS URL, then share that link. Anyone with the URL can access your local app while the tunnel session is active.
Can I share my local dev server without deploying?
Yes. A localhost tunnel exposes your running local app through a public URL without any staging or production deployment.
Is it safe to share a local dev server URL?
Yes for development previews using test data. Treat tunnel URLs as temporary, stop the session when finished, and avoid exposing production credentials or customer data.