Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

Change domain or subdomain

Learn how to change your production instance's domain or subdomain on Clerk.

Change domain

Production domains can be changed in the Clerk Dashboard(opens in a new tab) or via our backend API(opens in a new tab). 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 the production URL from the Clerk Dashboard, navigate to the Domains(opens in a new tab) page and select the Danger tab. Select Change domain.

The 'Danger' tab of the Domains page in the Clerk Dashboard.There is a red arrow pointing to the 'Change domain' button.

You will receive a prompt to enter your new production domain.

The 'Change domain' modal in the Clerk Dashboard.

Update your domain via backend API

To update the production URL using the backend API, you can copy the following cURL code. You will want to replace YOUR_SECRET_KEY with your Clerk secret key, which can be found on the API Keys(opens in a new tab) page of the Clerk Dashboard. Then, make sure to update the home_url field with your new production URL.

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 our backend API reference(opens in a new tab).

Update your publishable key

After changing your domain, a new Publishable key will be automatically generated for your application. You will need to update your environment variables with this new key and redeploy your application. You can find your Publishable key on the API Keys(opens in a new tab) page of the Clerk Dashboard.

Failing to update your Publishable key will result in Clerk failing to load.

Specify subdomain

If you would like to specify your subdomain of your application, go to the Clerk Dashboard and navigate to the Domains(opens in a new tab) page. Select the Danger tab.

The 'Danger' tab of the Domains page in the Clerk Dashboard.There is a red arrow pointing to the 'Set subdomain' button.

Change subdomain

You can update your subdomain via the Clerk Dashboard. Navigate to the Domains(opens in a new tab) page and select the Danger tab. Select Change subdomain.

The 'Danger' tab of the Domains page in the Clerk Dashboard.There is a red arrow pointing to the 'Change subdomain' button.

You will receive a prompt to enter your new subdomain.

The 'Change subdomain' modal in the Clerk Dashboard.

What did you think of this content?

Clerk © 2024