> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Updating your domain

To update your Anaconda Server domain, you need to update the domain variables in both the `.env` and `kc.yaml` files:

1. Open a terminal and connect to your instance of Anaconda Server.

2. Enter to your installer directory by running the following command:

   ```sh theme={null}
   # Replace <INSTALLER> with your installer directory
   cd <INSTALLER>
   ```

3. Make a copy of the current `.env` file for reference and/or recovery purposes:

   ```sh theme={null}
   cp .env .env.old
   ```

4. Using your preferred file editor, open the `.env` file.

5. Update the `DOMAIN` variable to your new domain.

   <Accordion title="Example .env file">
     <Frame>
       <img src="https://mintcdn.com/anaconda-29683c67/abCdQ9kzAxRqPlhZ/images/as_env_file_domain_change.png?fit=max&auto=format&n=abCdQ9kzAxRqPlhZ&q=85&s=9a4728c17a599b4465c03a08f8a0d3e2" alt="" width="2264" height="1498" data-path="images/as_env_file_domain_change.png" />
     </Frame>
   </Accordion>

6. Save your changes and close the file.

7. Enter your keycloak directory by running the following command:

   ```sh theme={null}
   cd keycloak/
   ```

8. Using your preferred file editor, open the `kc.yaml` file.

9. Locate the `clientId: repo-service` section of the file and add the following line:

   ```sh theme={null}
   # Replace URL with your Anaconda Server URL
   rootUrl: "<URL>"
   ```

   <Accordion title="Example kc.yaml file">
     <Frame>
       <img src="https://mintcdn.com/anaconda-29683c67/abCdQ9kzAxRqPlhZ/images/as_kc_yaml_file_domain_change.png?fit=max&auto=format&n=abCdQ9kzAxRqPlhZ&q=85&s=d83c5a1738ef44987d5b0ff36447bf69" alt="" width="2084" height="1124" data-path="images/as_kc_yaml_file_domain_change.png" />
     </Frame>
   </Accordion>

   <Note>
     If you have existing clients (tools) configured to use Anaconda Server instances using the old DNS name, you will need to update those clients as well.
   </Note>

10. Restart your pods and apply your changes by running the following commands:

    ```sh theme={null}
    docker compose up -d
    ```

11. Open a browser and [log in to the Keycloak administrative console](./user_roles#accessing-the-keycloak-administrative-console).

12. Verify you are on the **dev** realm.

13. Select **Clients** from the left-hand navigation.

14. Select the **repo-service** client.

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/_0MqQ39OoYOKQTk5/images/kc_dev_client_repo-service.png?fit=max&auto=format&n=_0MqQ39OoYOKQTk5&q=85&s=a970a0c36983be9e3bd2a8a7921bfcfb" alt="" width="1922" height="777" data-path="images/kc_dev_client_repo-service.png" />
    </Frame>

15. Update the **Root URL** to your new domain.

16. Prepend the Valid redirect URIs path with your new domain.

17. Click **Save**.

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/_0MqQ39OoYOKQTk5/images/kc_dev_repo-service_new_domain.png?fit=max&auto=format&n=_0MqQ39OoYOKQTk5&q=85&s=7775d09b2091043bd15e0ce1bca2132c" alt="" width="1908" height="938" data-path="images/kc_dev_repo-service_new_domain.png" />
    </Frame>

    <Tip>
      If Keycloak demands you also update the **Backchannel logout URL**, add your new domain to the field under **Logout settings**, then save your changes. Next, delete the entry you just made and attempt to save again.
    </Tip>

18. If you are using SSL, [update your certificates](/docs/psm-on-prem/6.6.2/admin/ssl) to refer to your new domain.

19. You can now log in to Anaconda Server normally.
