Skip to main content
This guide explains how to expose your local MongoDB server using ngrok TCP endpoints.

What you’ll need

  • MongoDB installed and running locally.
  • An ngrok account.
  • Your ngrok authtoken.
  • A valid payment method added to your account (TCP endpoints are only available on a free plan after adding a valid payment method).

Expose your MongoDB server

Use a TCP endpoint to expose your local MongoDB server. Open an ngrok TCP endpoint to your local MongoDB service, which is usually running on port 27017.
ngrok tcp 27017

Connect to your database

Once ngrok is forwarding traffic to your MongoDB service, use the TCP address and port from the ngrok output to connect from your preferred client.