Change domain or subdomain
Learn how to change your Clerk production instance's domain or subdomain.
Change domain
- Update your production domain using either of the following options:
- 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 sidenav, select Domains.
- Scroll to find the Change domain setting.
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 is required to authenticate the request. It is injected into the cURL command after
Authorization.
- Replace
YOUR_SECRET_KEYwith your Clerk .
- Replace
YOUR_PROD_URLwith your new production domain.
curl -XPOST -H 'Authorization: YOUR_SECRET_KEY' -H "Content-type: application/json" -d '{
"home_url": "YOUR_PROD_URL"
}' 'https://api.clerk.com/v1/instance/change_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 will be automatically generated for your application. You need to update your environment variables with this new key and redeploy your application.
Feedback
Last updated on