To make your local Node.js app live on the internet using ngrok, follow these steps:
✅ Prerequisites:
- Your Node.js app should already be running (e.g., on port
3000
or any other port). - ngrok installed on your machine.
🔧 Step-by-Step Guide:
1. Install ngrok (if not already installed):
npm install -g ngrok
Or download from: https://ngrok.com/download
2. Start your Node.js app locally
For example:
node app.js
Let’s assume it runs on http://localhost:3000
3. Sign up for a free ngrok account:
Go to: 👉 https://dashboard.ngrok.com/signup
4. Verify your email (if prompted)
5. Get your authtoken:
After login, go to: 👉 https://dashboard.ngrok.com/get-started/your-authtoken
You’ll see something like:
ngrok config add-authtoken 2S6abc123XYZ....
6. Copy and run the command in your terminal:
ngrok config add-authtoken YOUR_AUTHTOKEN_HERE
Replace
YOUR_AUTHTOKEN_HERE
with your actual token
7. Now start ngrok again:
ngrok http 3000
You should now see:
Forwarding https://abcd1234.ngrok.io -> http://localhost:3000
Click on Visit Site
✅ You’re live on internet!