> ## 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 Package Security Manager 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 Package Security Manager.

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] Example .env file
   >
   > ![](https://mintcdn.com/anaconda-29683c67/NJcmnqSLAoz4wiuS/images/psm-on-prem/as_env_file_domain_change.png?fit=max\&auto=format\&n=NJcmnqSLAoz4wiuS\&q=85\&s=173b1114fed889843d5cf8e2d34497c9)

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 Package Security Manager URL
   rootUrl: "<URL>"
   ```

   > [accordion] Example kc.yaml file
   >
   > ![](https://mintcdn.com/anaconda-29683c67/NJcmnqSLAoz4wiuS/images/psm-on-prem/as_kc_yaml_file_domain_change.png?fit=max\&auto=format\&n=NJcmnqSLAoz4wiuS\&q=85\&s=a3eac48c1f4c6a9e96d28c938fbe0798)

   > [!NOTE]
   >
   > If you have existing clients (tools) configured to use Package Security Manager instances using the old DNS name, you will need to update those clients as well.

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

    ```sh theme={null}
    docker-compose down
    docker compose up --detach
    ```

11. [Log in to the Keycloak administrative console](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/user_config/user_roles.md#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.

    ![](https://mintcdn.com/anaconda-29683c67/9t4S9uQ-n8Qk5XW_/images/psm-on-prem/kc_dev_client_repo-service.png?fit=max\&auto=format\&n=9t4S9uQ-n8Qk5XW_\&q=85\&s=8048075e394927a755e69a3363530522)

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

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

17. Click **Save**.

    ![](https://mintcdn.com/anaconda-29683c67/9t4S9uQ-n8Qk5XW_/images/psm-on-prem/kc_dev_repo-service_new_domain.png?fit=max\&auto=format\&n=9t4S9uQ-n8Qk5XW_\&q=85\&s=9547406eb08d00e982773ba63b55ded4)

    > [!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.

18. If you are using SSL, [update your certificates](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/advanced/ssl.md) to refer to your new domain.

19. You can now log in to Package Security Manager normally.
