Skip to main content
Running in K8s? Check out this guide on securely connecting your local cluster to customer networks.
This quickstart walks you through the fastest path to a working site-to-site connection using ngrok. You’ll learn how to:
  • Configure an agent in a remote network
  • Create a Cloud Endpoint
  • Verify that traffic flows end-to-end

What you’ll need

  • An ngrok account.
  • The ngrok agent installed on a machine inside the remote network you want to connect to.
  • A service running in the remote network that you want to reach (this quickstart uses port 8080 as an example).

1. Configure an Internal Endpoint

Open the ngrok configuration file on the remote machine and add an Internal Endpoint that points to the service you want to access. You can do so by editing your config file with the ngrok config edit terminal command. Update yours to resemble the following snippet.
ngrok.yml
Replace YOUR_AUTHTOKEN with the authtoken from your ngrok dashboard. Internal Endpoints are private endpoints that only receive traffic when a Cloud Endpoint forwards to them using the forward-internal Traffic Policy action. Next, start the agent:
Your service still can’t be reached until you create a Cloud Endpoint to route traffic to it.

2. Create a Cloud Endpoint

Cloud Endpoints are persistent, always-on endpoints managed from the dashboard or API. They use an attached Traffic Policy to handle incoming connections. Create a new Cloud Endpoint in the dashboard. After it’s created, you’re taken to the Traffic Policy editor view. Replace the default Traffic Policy with the following:
This routes all incoming traffic on the Cloud Endpoint to the Internal Endpoint you configured in step 1.

3. Test the connection

Copy the URL of the Cloud Endpoint you just created from the dashboard, then send a request to verify traffic reaches your service:
You should see the response from the service running on port 8080 in the remote network.

What’s next