Skip to content

Instantly share code, notes, and snippets.

@hassan404
Created March 25, 2025 09:43
Show Gist options
  • Save hassan404/8d5e3b080b54244e18c16fa381ea096f to your computer and use it in GitHub Desktop.
Save hassan404/8d5e3b080b54244e18c16fa381ea096f to your computer and use it in GitHub Desktop.
Ngrok fixed domain configuration

ngrok Configuration with a Fixed Domain

This guide explains how to set up ngrok with a fixed domain using an Edge.


1. Claim a Free Static Domain

  1. Go to ngrok Dashboard → Domains.
  2. Click "New Domain" and create one

2. Create an Edge in ngrok

  1. Navigate to ngrok Dashboard → Edges
  2. Click "New Edge" and select "HTTPS Edge".
  3. Assign your existing domain.
  4. Copy the Edge ID (e.g., edghts_XXXXXXXXX).

3. Configure ngrok.yml

Edit your ngrok configuration:

ngrok config edit

Replace with:

version: 3
agent:
  authtoken: XXXXXXXXXXXXXXX
tunnels:
  backend:
    labels:
      - edge=edghts_XXXXXXXXX
    addr: http://localhost:8000
    inspect: false

Configuration Details

  • authtoken: Get from dashboard
  • edge=edghts_XXXXXXXXX: Uses the Edge ID for a fixed domain.
  • addr: Maps to your local service (localhost:8000 and localhost:3000).
  • inspect: false: Disables ngrok’s web inspector.
  • can replace backend with any word

Ctrl+X to save

4. Start ngrok with Configured Edge

Run:

ngrok start backend

Now, your backend and frontend will be accessible at your fixed ngrok domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment