Ngrok, a popular platform that allows developers to expose their local services to the Internet, has announced a new feature that will make it easier for them to test and deploy their applications. Starting from today, all ngrok users can claim one static domain for free, instead of relying on time-limited, random domains.
What is ngrok and why is it useful?
Ngrok is a tool that creates a secure tunnel between a developer’s machine and the ngrok cloud service, allowing anyone on the Internet to access the local service through a public URL. This is especially useful for testing webhooks, APIs, mobile apps, and other services that require external access.
Ngrok has long offered a free tier to its users, albeit with some limitations. In particular, the tunnel link associated to a free account expires after eight hours, which requires the ngrok service to be restarted to set up a new tunnel, ensuing in the creation of a new random domain to use to access the exposed service.
How does the static domain feature work?
Static domains are unique domains that are yours and don’t change. With your free static domain, you can focus on developing your application, and no longer need to worry about broken links caused by agent restarts. There’s no need to constantly keep updating webhook providers or mobile apps with new URLs or send new links to your team.
To claim your static domain, you need to log in to your ngrok account and navigate to Cloud Edge > Domains. There you can follow the prompts to claim your unique, static domain. A static domain is a subdomain of one of number of ngrok-owned domains, such as ngrok.io, ngrok-free.app and others, and have thus the form panda-new-kit.ngrok-free.app.
Once you have your static domain, you can use it from the ngrok CLI or any of the ngrok Agent SDKs, which are available for a variety of languages including go, rust, and others. For example, you can create a tunnel with your static domain using the following command:
ngrok http --domain=panda-new-kit.ngrok-free.app 80
What are the benefits of using a static domain?
Using a static domain has several advantages over using a random domain. First of all, it saves you time and hassle of updating your links every time you restart your ngrok service. Secondly, it enables you to use ngrok not just in test/dev environments, but also for production use-cases. If you don’t require a branded domain, you can now run your first production app on ngrok’s free tier. This is suitable for pre-release versions or internal apps. You can always upgrade later to bring your own custom domain when you’re ready to put it in front of customers.
Another benefit of using a static domain is that it allows you to use ngrok’s Kubernetes Ingress Controller, which can be seen as a Kubernetes-native API wrapped around ngrok’s platform to provide public and secure ingress traffic to k8s services.
How can I get started with ngrok and static domains?
If you are interested in trying out ngrok and its static domain feature, you can sign up for a free account on their website. You can also check out their blog post for more details and examples of how to use static domains with different tools and frameworks.