Custom Domain Setup
Configure your custom domain for Agentic Team OS
Learn how to set up and configure custom domains for your Agentic Team OS deployment. This guide covers domain structure, DNS configuration, and environment-specific settings.
Prerequisites
- Purchase a domain through Cloudflare or transfer your exiting domain to Cloudflare
- Set the domain SSL/TLS encryption mode to “Full Strict”
- Generate a Cloudflare API key with the following permissions:
- Access: Organizations, Identity Providers, and Groups:Read
- Account Settings:Read
- Account Settings:Edit
- Account Settings:Edit
When setting up DNS records for the first time, the initial deployment through SST may be slow because it needs to bootstrap the DNS records. Subsequent updates will be alot faster.
Domain Configuration
Each template (API, Dashboard, Landing) can be configured with its own subdomain:
The url structure is as follows:
Environment sepcific configuraitons
Under the Hood
SST is used to automate the confguration of your custom domains.
You will need to add cloudflare as a provider and make the API key environment avilable.
This is done for you in each template.
See below for the configuration of each template.
Add Your Custom Domain to the API Template
To add your custom domain to the API template, you need to set the CLOUDFLARE_API_TOKEN
and BASE_DOMAIN
environment variables in your .env.{stage}
file.
Below breaks down the configuration of the API template that automatically configures the custom domain.
- Provider Configuration:
The
sst.config.ts
file configures Cloudflare as a provider alongside AWS:
- Custom Domain Configuration: In the API configuration file, the custom domain is set up using SST’s ApiGatewayV2 construct with Cloudflare DNS integration:
Update the environment variables in the env
file with your domain name and cloudflare api token.
This will be used by sst.config.ts
to construct the domain name.
Add Your Custom Domain to the Dashboard Template
To add your custom domain to the Dashboard template, you need to set the CLOUDFLARE_API_TOKEN
and BASE_DOMAIN
environment variables in your .env.{stage}
file.
Below breaks down the configuration of the Dashboard template that automatically configures the custom domain.
The sst.config.ts
file configures the custom domain and Cloudflare provider:
This configuration:
- Sets up the dashboard subdomain (e.g., app.yourdomain.com)
- Configures stage-specific domains (e.g., dev-app.yourdomain.com)
- Enables Cloudflare proxying for the domain
- Sets appropriate TTL values
- Automatically manages DNS records through Cloudflare
The domain structure follows these patterns:
- Production:
app.yourdomain.com
- Other stages:
{stage}-app.yourdomain.com
Landing Page Template
To add your custom domain to the Landing Page template, you need to set the CLOUDFLARE_API_TOKEN
and BASE_DOMAIN
environment variables in your .env.{stage}
file.
Below breaks down the configuration of the Landing Page template that automatically configures the custom domain.
The sst.config.ts
file handles domain configuration:
This configuration:
- Sets up the main domain and www subdomain
- Configures stage-specific domains (e.g., dev.yourdomain.com)
- Enables Cloudflare proxying for the www subdomain
- Automatically manages DNS records through Cloudflare
Was this page helpful?