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
- Start your application locally (for example on port 3000).
- Run
npx portpreview 3000to create a public HTTPS URL. - Copy the URL and send it to your collaborator via Slack, email, or your project tool.
- They open the link in any browser—no special software required.
- 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.
