How to Change a Cloud Endpoint Domain
If you want to change the matching domain for your active Cloud Endpoint without any downtime to your services, you can use the ngrok API to update its values instead of deleting and recreating the endpoint in the dashboard.
What you'll need
- An ngrok API key.
- An active cloud endpoint.
1. Reserve your domain
Reserve the new domain you'd like to use for your cloud endpoint.
To reserve a domain, navigate to the dashboard, visit the Domains section, and select + New Domain. You can choose a free static domain, or you can use a custom domain you already own.
2. Configure your API key
If this is your first time using the ngrok API, add your API key to your config file:
Loading…
You can verify that the API key is set by running:
Loading…
You should see your key near the top of the output.
3. Get the ID of the endpoint you want to modify
Next you'll need your endpoint's ID. To see a complete list of your endpoints, run:
Loading…
Find the endpoint you want to modify and note its ID, which is a long character string beginning with ep_
.
You can also find your endpoint ID in the Endpoints section of the dashboard.
4. Update the endpoint with the new domain
Run the following command to change your cloud endpoint's URL, replacing $YOUR_ENDPOINT_ID
and $YOUR_DOMAIN
with their respective values from the previous steps:
Loading…
5. Test your new endpoint URL
To verify that the change was successful, run:
Loading…
You should see the new URL in the output, confirming that your cloud endpoint is now running there.