Static domains for all ngrok users

We are excited to announce the launch of one of our most requested features: static domains for free users. Starting today, all users can reserve one static domain for free.

Static domains are unique to your account and remain yours until you delete them. You specify a subdomain, like your-company, and attach that to one of the available root domains—e.g. ngrok.app or ngrok.dev.

With your free static domain, you can focus on developing your application or configuring ngrok as your API gateway without needing to worry about how to deal with the default behavior of the ngrok agent, which is to generate a random URL like https://9490551445c1.ngrok.app. That makes the development and testing lifecycle even easier, especially for pre-release versions or internal apps.

If you don't need a branded domain, you can now run your first production app on ngrok’s free tier. Should those needs change, you can always upgrade to a pay-as-you-go plan and bring a branded domain, which allows you to create and number of endpoints like api.your-company.com and app.your-company.com without limits.

Our mission is to equip developers with composable infrastructure that makes putting APIs and apps online as simple as ngrok http .... Free static domains get all of us one crucial step closer to that vision.

Reserve your static domain

Follow these steps:

  1. Log in to your ngrok account.
  2. Navigate to Universal Edge > Domains and click + New Domain (or just click the link to take you straight there).
  3. Type in your subdomain and choose one of the ngrok domains.

Put your new static domain to use

With a static domain for your apps and APIs, you can use ngrok to front all your APIs or apps whether you're testing on localhost or wiring up a production multi-cloud API gateway.

With the ngrok CLI

The fastest way to get started with your static domain to create an agent endpoint. In this case, your new static domain would route traffic directly to the API or app service running on port 80.

ngrok http 80 --url=<YOUR_STATIC_DOMAIN>

With a cloud endpoint

Cloud endpoints are always online and not tied to the lifecycle of an ngrok agent—you can think of them like serverless functions for handling traffic.

Head to Endpoints > + New and type in your reserved static domain.

Cloud endpoints are perfect for creating a single point of ingress for your root domain at your-company.com—that's exactly what we do for ngrok.com. When combined with internal endpoints, you can route traffic to any number of upstream services and control the configuration from one place.

ngrok agent SDKs

Another way to use ngrok and your static domains is via the ngrok Agent SDKs, which allow you to embed ngrok's functions directly into your APIs or apps.

For example, using the ngrok-go SDK:

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"

	"golang.ngrok.com/ngrok"
	"golang.ngrok.com/ngrok/config"
)

func main() {
	tun, err := ngrok.Listen(context.Background(),
		config.HTTPEndpoint(config.WithDomain("<YOUR_STATIC_DOMAIN>")),
		ngrok.WithAuthtokenFromEnv(),
	)
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Application available at:", tun.URL())
	err := http.Serve(tun, http.HandlerFunc(handler))
	if err != nil {
		log.Fatal(err)
	}
}

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "Hello from ngrok-go!")
}

Once you run go run main.go, the ngrok creates an agent endpoint on your static domain and makes this application accessible from anywhere in the world.

On a Kubernetes clusters

If you're using Kubernetes to make your APIs or apps available to the public, you can leverage our Kubernetes Operator to handle ingress and load balancing without dealing deeply with the Ingress or Gateway API objects.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
spec:
  ingressClassName: ngrok
  rules:
  - host: <YOUR_STATIC_DOMAIN>
    http:
      paths:
      - path: /
        backend:
          serviceName: example-service
          servicePort: 80

The Kubernetes Operator then creates pods and services to route all traffic on https://<YOUR_STATIC_DOMAIN> to the example-service pod.

Sign up and get started today

In case you don’t yet have an ngrok account, you can sign up for free, which lets you claim 1 static domain.

When you're ready to start using ngrok for production, upgrade to a pay-as-you-go account. You can then reserve your custom branded domain, like your-company.com, and update your DNS records to point to ngrok to create as many subdomains as you need and handle ingress to all your services from one place.

Let us know if you run into any problems or have any questions either by email our customer success team or by dropping an issue in our community repo.

Share this post
Nijiko Yonskai
Niji is a Principal Product Manager who helps shape ngrok user experience. Previously product at Kong and Postman.
Cloud edge
Static domain
Features
Production