> ## 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 (On-prem) 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 title="Example .env file">
     <Frame>
       <img src="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" alt="" width="2264" height="1498" data-path="images/psm-on-prem/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 Package Security Manager URL
   rootUrl: "<URL>"
   ```

   <Accordion title="Example kc.yaml file">
     <Frame>
       <img src="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" alt="" width="2084" height="1124" data-path="images/psm-on-prem/as_kc_yaml_file_domain_change.png" />
     </Frame>
   </Accordion>

   <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.
   </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/9t4S9uQ-n8Qk5XW_/images/psm-on-prem/kc_dev_client_repo-service.png?fit=max&auto=format&n=9t4S9uQ-n8Qk5XW_&q=85&s=8048075e394927a755e69a3363530522" alt="" width="1922" height="777" data-path="images/psm-on-prem/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/9t4S9uQ-n8Qk5XW_/images/psm-on-prem/kc_dev_repo-service_new_domain.png?fit=max&auto=format&n=9t4S9uQ-n8Qk5XW_&q=85&s=9547406eb08d00e982773ba63b55ded4" alt="" width="1908" height="938" data-path="images/psm-on-prem/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.5/admin/ssl) to refer to your new domain.

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