--- title: "Connect via Ngrok" description: "Expose Miget services and apps to the internet using Ngrok." --- 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](https://app.miget.com/apps). 2. **Ngrok Free Tier Account** - Sign up at [Ngrok](https://dashboard.ngrok.com/). 3. **Ngrok Authtoken** - Navigate to the [Ngrok dashboard](https://dashboard.ngrok.com/cloud-edge/endpoints) 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**](https://app.miget.com/apps/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**](https://app.miget.com/apps/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](https://github.com/migetapp/ngrok) ```bash git clone git@github.com:migetapp/ngrok.git ``` 3. Follow the deployment instructions in the **Deploy tab**: ```bash cd ngrok git remote add miget https://git.eu-east-1.miget.io// git push miget ``` Replace `` and `` 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](https://dashboard.ngrok.com/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](https://dashboard.ngrok.com/cloud-edge/endpoints). 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.