Skip to main content
In this quick guide, we will show you how to automatically customize your preview URL when a new environment has been created using the Qovery CLI. By following these steps, you can create a custom domain for your service and link it to your DNS provider.

Prerequisites

  • Qovery CLI installed
  • Access to your DNS provider

Step 1: Create a Custom Domain for Your Service

To create a custom domain for your service, run the following command in your terminal:
Replace app name with the name of your application and app.domain.name with your desired custom domain. Use --organization, --project, --environment flags to specify the organization, project, and environment where you want to create the custom domain.

Step 2: Retrieve the Validation Domain

To get the validation domain required for the next step, run the following command:
Replace app name and app.domain.name with the appropriate values. This command will output the validation domain.

Step 3: Create a CNAME Record in Your DNS Provider

Use the validation domain from the previous step to create a CNAME record in your DNS provider. The CNAME record should point to the validation domain. Example with Route53:
Example with Cloudflare:
The idea here is to create a CNAME record that points to the validation domain. The validation domain is a temporary domain that is used to validate the ownership of the custom domain.

Step 4: Redeploy Your Application

Once the DNS changes have propagated, redeploy your application to complete the process.
Your application should now be available at app-{PR ID}.domain.name.

Wrapping Up

Congratulations! You have successfully customized your preview URL using the Qovery CLI. Now, whenever a new environment is created, the custom domain will be automatically configured. If you encounter any issues, please reach out to our support team.