Change domain or subdomain
Learn how to change your Clerk production instance's domain or subdomain.
Change domain
- Update your production domain in two ways:
- the Clerk Dashboard
- the Backend API
- Once you make the change to your domain, you will need to update the following:
- Update DNS records
- Generate new SSL certificates
- Update your Publishable Key
- If using social connections, update the settings with your social connections so that the redirect URL they are using is correct.
- If using JWT templates, update JWT issuer and JWKS Endpoint in external JWT SSO services.
Update your domain via Clerk Dashboard
To update your production domain in the Clerk Dashboard:
- In the navigation sidebar, select Domains.
- Select the Danger tab.
- Select Change domain.
Update your domain via Backend API
To update your production domain using the Backend API, you will need to make a POST request to the change_domain
endpoint. You will need to provide your new domain in the request body.
- Copy the following cURL command.
- Your Secret Key is required to authenticate the request. It is injected into the cURL command after
Authorization
. However, you can also find it on the API keys page in the Clerk Dashboard.
- Your Secret Key is required to authenticate the request.
- Navigate to the Clerk Dashboard and sign in.
- In the navigation sidebar, select API keys to copy your Secret Key.
- Paste your Secret Key into the cURL command after
Authorization
, replacingsk_...
.
- Replace
YOUR_PROD_URL
with your new production domain.
For more information on how to update your instance settings using the Backend API, see the Backend API reference.
Update your Publishable Key
After changing your domain, a new Publishable Key will be automatically generated for your application. You need to update your environment variables with this new key and redeploy your application. You can find your Publishable Key on the API keys page in the Clerk Dashboard.
Set, change, or remove subdomain
To set, change, or remove a subdomain for your production instance:
- Navigate to the Clerk Dashboard.
- In the navigation sidebar, select Domains.
- Select the Danger tab.
- You will see the Change subdomain section where you can set, change, or remove your subdomain.
Feedback
Last updated on