Skip to content

This notebook belongs to

Sadat Jubayer

Senior Software Engineer at Premio

If found, please return to hello@jubayer.dev

Vol. 7Seven years of building

Started
January 2020
Everyday tools
TypeScript, Vue, React, Next.js, NestJS, React Native
Education
B.Sc. CSSE, AIUB, 2020
1 min readDev Tool

Share your local server with ngrok

Use ngrok to give someone a temporary public URL for a local development server.

You have a project running on your laptop and want someone to try it. A localhost URL points to the computer that opens it. An ngrok tunnel gives your local server a public URL you can share.

Start the tunnel

Install ngrok, create an account, and copy your authtoken from the ngrok dashboard.

2022 update. The original v2 command was ngrok authtoken. With ngrok Agent v3, use ngrok config add-authtoken.

ngrok config add-authtoken YOUR_AUTHTOKEN
ngrok http 3000

Replace YOUR_AUTHTOKEN with your own token, and use the port your development server is listening on in place of 3000. ngrok prints a public HTTPS address under Forwarding. Open it to check that it reaches your project, then send the address to the person testing it.

This example uses port 80. Visitors to the forwarding URL reach the local server through the tunnel until you stop the agent.

Anyone with the forwarding URL can reach the app unless you add access controls. Share a demo you intend to make reachable, and press Ctrl+C in the terminal when you're done.