When your Leap application is ready for production, you may want to serve it from your own domain rather than the default Encore-provided URL. This guide walks you through the process of connecting a custom domain to your Leap application.
Custom domains are available as part of the Encore Cloud Pro plan.

Setting up a Custom Domain

Follow these steps to connect your domain to your Leap application:
  1. In your Leap project, click the Deploy button in the top-right corner
  2. After deployment, click the Connect domain button which will take you to the Encore Cloud dashboard
  3. On the Encore Cloud dashboard, navigate to the Custom Domains section
  4. Click the Add Domain button to open the domain configuration modal
Add Domain Modal In the Add Domain modal:
  1. Enter your domain (e.g., your-domain.com)
  2. The modal will show you the DNS record you need to add to your domain provider:
    Type: CNAME
    DNS Record: api.your-domain.com (your subdomain)
    Value: custom-domain.encr.app
    
  3. Select the environment and gateway you want to assign the domain to:
    • API Gateway: Choose this for your backend API endpoints (e.g., api.your-domain.com)
    • Frontend Gateway: Choose this for your user-facing frontend application (e.g., app.your-domain.com)
  4. Click Add to complete the setup
  5. Add the specified DNS record with your domain provider (see DNS Configuration section below)
Your custom domain comes with DDoS protection powered by Cloudflare WAF.

DNS Configuration

After adding your domain, you’ll need to set up the appropriate DNS records with your domain registrar. Select your provider below for specific instructions.
  1. Log in to your Namecheap account
  2. Go to Domain List and click Manage next to your domain
  3. Select the Advanced DNS tab
  4. Click Add New Record
  5. Enter the following details:
    • Type: CNAME Record
    • Host: Enter your subdomain (e.g., api for api.your-domain.com)
    • Value: custom-domain.encr.app
    • TTL: Automatic
  6. Click Save All Changes

Verifying Your Domain

After setting up the DNS record:
  1. It may take some time for DNS changes to propagate (typically 15 minutes to 48 hours)
  2. You can check the status of your domain on the Encore Cloud dashboard
  3. Once verified, your application will be accessible via your custom domain
If you’ve set up multiple gateways with custom domains, make sure to configure your application to properly handle requests between them. For example, your frontend might need to know the URL of your API gateway to make requests.

Troubleshooting

If you encounter issues with your custom domain setup:
  • Verify that your DNS record is correct and matches the provided instructions
  • Check if your DNS changes have propagated using a tool like dnschecker.org
  • Ensure your domain doesn’t have conflicting DNS records
  • Contact support via the Encore Cloud dashboard if you continue to experience issues