This guide shows how to connect to Miget-managed services that are within a private network using Ngrok. Ngrok enables you to securely expose services running on private networks to the internet through a public endpoint, allowing you to access your services from anywhere.

Prerequisites

Before you start, ensure you have:
  1. Miget Account – Register at Miget.
  2. Ngrok Free Tier Account – Sign up at Ngrok.
  3. Ngrok Authtoken – Navigate to the Ngrok dashboard and generate your NGROK_AUTHTOKEN.
  4. Miget Service – An existing or newly created Miget app with a service you want to expose.

Steps to Connect Using Ngrok

Create a Miget App

If you haven’t created an app yet:
  1. In the Miget dashboard, click New to create a new app.
  2. Choose your preferred settings and give your app a name.

Get Service Endpoint

Once your service is running:
  1. Go to the service details page.
  2. Copy the service hostname and port number (click Show to reveal endpoint details).

Create Another Miget App for Ngrok

  1. In the Miget dashboard, click New to create another app.
  2. Name this app something like ngrok.

Deploy Ngrok from GitHub

  1. Set Builder to Dockerfile under Settings → Builders.
  2. Deploy the Ngrok app from this GitHub repository: https://github.com/migetapp/ngrok
git clone git@github.com:migetapp/ngrok.git
  1. Follow the deployment instructions in the Deploy tab:
cd ngrok
git remote add miget https://git.eu-east-1.miget.io/<your-workspace>/<your-app-name>
git push miget
Replace <your-workspace> and <your-app-name> with your actual Miget workspace and app name.

Add Environment Variables

Once the Ngrok app is deployed, add the following environment variables under Settings → Config Vars → Edit Config Vars:
  • NGROK_AUTHTOKEN – Obtain from your Ngrok dashboard. Go to Ngrok Cloud Edge Endpoints, click Start a Tunnel, select Start a tunnel with a Docker container, and copy the NGROK_AUTHTOKEN value.
  • MIGET_SERVICE_NAME – The hostname of your service endpoint.
  • MIGET_SERVICE_PORT – The port number of your service.

Get Ngrok Public Endpoint

Navigate to Ngrok Cloud Edge → Endpoints in your Ngrok dashboard. Here you will find the public endpoint provided by Ngrok.

Connect to Your Service

Now that you have the public Ngrok endpoint, you can connect to your service using the appropriate client for your service type.
Replace the Ngrok hostname and port with the values from your Ngrok endpoint.

Summary

By following these steps, you can securely access your Miget-managed services using Ngrok from outside the private network. Once your Ngrok connection is set up, you can access other services in a similar fashion by modifying the environment variables for different services.