Each deployed site can have its own domain, which can be Appwrite-generated or custom. You can use this domain to consume web apps deployed on Appwrite Sites. Appwrite generates TLS certificates to enforce HTTPS on all Appwrite Sites domains. These domains are safe to use and access in production.
Learn about Sites development >
Generated domains
Each site automatically receives a unique Appwrite-generated domain that's ready to use immediately.
- In the Appwrite Console's sidebar, click Sites.
- Under the Domains tab, you'll find the domain generated by Appwrite.
The domain usually has this format:
https://64d4d22db370ae41a32e.appwrite.networkBranch and Commit URLs
Additional to the site URL, Appwrite also generates a URL for the branch and commit that your site has been deployed from. The branch URL will remain consistent for all deployments made for code pushed to a specific branch, whereas the commit URL will be updated every time a new deployment is made via the Git integration (i.e. when code is pushed to your repo).

To find the branch and commit URLs of any deployment, follow these steps:
- Navigate to your site on Appwrite Console.
- Head to the Deployments tab and click on any deployment.
- The panel lists every URL for that deployment under URLs, including the branch and commit URLs.
Add a custom domain
You can add your own domain to your Appwrite site to provide a branded experience for your users. There are two ways to add a custom domain, depending on whether you're using a subdomain or an apex domain.
Add an apex domain with NS records
Apex domains (also known as root domains) are domains without a subdomain prefix, like example.com instead of www.example.com. Unlike subdomains, apex domains cannot use CNAME records due to DNS protocol limitations.
To add an apex domain via NS records:
- Navigate to your site in the Appwrite Console.
- Head to the Domains tab and click on Add domain.
- Enter your apex domain (e.g.,
example.com). - Select the appropriate domain rule type (Active deployment, Git branch, or Redirect) and configure its settings. See the Domain rule types section for details.
- Appwrite will provide NS record information.
- Go to your domain registrar and update the NS records for your domain to point to
ns1.appwrite.zoneandns2.appwrite.zone. - Return to the Appwrite Console and wait for the verification process to complete.

DNS changes can take up to 48 hours to fully propagate across the internet. During this time, your domain might not be accessible or might show inconsistent behavior.
Why Appwrite uses NS records instead of A records
By DNS standards (RFC), apex domains cannot use CNAME records, only A or AAAA records, which require pointing to fixed IP addresses. Using A records would lock Appwrite into specific IP addresses, limiting our ability to optimize routing, scale our infrastructure, or make changes as needed. To avoid this constraint and maintain flexibility, Appwrite offers DNS delegation through NS records so we can manage routing on your behalf.
Using Appwrite's DNS servers for your apex domain provides several benefits:
- Proper SSL certificate management
- Automatic DNS configuration
- Secure and reliable DNS resolution
When you change your domain's NS records, you're delegating DNS management to Appwrite. This means any existing DNS records (like MX records for email) will need to be recreated in Appwrite's DNS configuration.
Add an apex domain without changing nameservers
To add an apex domain without changing your NS records via CNAME flattening:
- Navigate to your site in the Appwrite Console.
- Head to the Domains tab and click on Add domain.
- Enter your apex domain (e.g.,
example.com). - Select the appropriate domain rule type (Active deployment, Git branch, or Redirect) and configure its settings. See the Domain rule types section for details.
- Copy the CNAME record provided by Appwrite.
- Copy the CAA record provided by Appwrite.
- In your DNS provider's settings, create an ALIAS, ANAME, or CNAME record at the apex (depending on what your provider supports).
- Point the record to the Appwrite hostname provided in the console.
- Add the CAA record to your DNS provider's settings, also pointed at the apex. If you already have CAA records on your domain, keep them and add Appwrite's alongside them. See Setting multiple CAA records.
- Return to the Site settings and wait for verification status.

DNS changes can take up to 48 hours to propagate. Once verified, your apex domain will be ready to use with full control over your remaining DNS configuration.
Add a subdomain with CNAME
Subdomains (like www.example.com or app.example.com) are set up using CNAME records, which point to Appwrite's hostname.
To add a subdomain:
- Navigate to your site in the Appwrite Console.
- Head to the Domains tab and click on Add domain.
- Input your subdomain (e.g.,
www.example.com). - Select the appropriate domain rule type (Active deployment, Git branch, or Redirect) and configure its settings. See the Domain rule types section for details.
- Copy the specified CNAME record and add it to your domain registrar.
- Return to the Site settings and wait for verification status.

DNS records can take up to 48 hours to propagate. Once verified, the domain is ready to use.
Domain used by another project
A domain belongs to one project at a time. If another project tries to add a domain that your project has added but not verified yet, Appwrite asks for a TXT record that proves who owns the domain:
- Your project added the domain first. Its DNS records show a required
TXTrecord named_appwrite.<domain>with your project ID as the value. Add it at your DNS provider. Until it is found, the domain does not verify on itsCNAME,A, orAAAArecord alone. - Another project added the domain first. Adding the domain returns an error that asks for a
TXTrecord named_appwrite.<domain>with your project ID as the value. Add it at your DNS provider, then add the domain again to move it to your project.
Appwrite checks a domain automatically for 3 days after it is added. If the domain was added more than 3 days ago, add the TXT record, then click Verify (or Retry) on the domain to check it again.
A verified domain is never asked for the TXT record, and its certificate renews without it.
Domain rule types
When adding a custom domain to your Appwrite site, you'll need to select one of the following rule types that determine how your domain will behave:
Active deployment
Points your domain to the latest deployed version of your site. This is the most common option for production domains.
- When selected, your domain will always serve the most recent successful deployment
- Any new deployments will automatically be available on this domain
Git branch
Points your domain to a specific branch in your repository. This is useful for testing or staging environments.
- When selected, you'll need to choose a specific branch from your connected repository
- Your domain will always serve the latest successful deployment from that branch
- This allows you to have different domains for different branches (e.g., staging.example.com for your staging branch)
Redirect
Forwards all traffic from your domain to another URL. This is useful for domain migrations or creating shortcuts.
- When selected, you'll need to specify the destination URL
- You can choose from various HTTP status codes for the redirect:
- 301 Moved permanently
- 302 Found
- 307 Temporary redirect
- 308 Permanent redirect
When you redirect an added domain to another URL, any additional path and queries will be ignored.
For example, if a domain example.com is set to redirect to appwrite.io, example.com/docs?id=123 will also redirect to appwrite.io.
Update a domain
You can change what a domain serves without removing it. The domain keeps its DNS records and TLS certificate, so there is nothing to change at your DNS provider and nothing to verify again.
- Navigate to your site in the Appwrite Console.
- Head to the Domains tab.
- Click the three-dots menu at the end of the domain's row, or right-click the row, and click Update.
- Choose what the domain serves and click Update.

What you can change depends on the domain's rule type:
| Current rule type | What you can change |
|---|---|
| Active deployment or Git branch | Switch between the active deployment and a branch, or pick a different branch |
| Redirect | The destination URL and the status code |
A domain can't switch between serving your site and redirecting. To make that change, delete the domain and add it again with the other rule type.
To serve a branch, the site needs a connected Git repository, and the branch needs at least one successful deployment. If the branch has none, Appwrite refuses the update and the domain keeps serving what it served before.
Update a domain with the API
The updateSiteRule and updateRedirectRule methods of the Proxy service make the same changes from your server, with an API key that has the rules.write scope. Pass the rule ID, which you can find with listRules. Leave out branch to serve the site's active deployment.
import { Client, Proxy } from 'node-appwrite';
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject('<PROJECT_ID>') .setKey('<API_KEY>');
const proxy = new Proxy(client);
// Serve the newest successful deployment from the staging branchawait proxy.updateSiteRule({ ruleId: '<RULE_ID>', siteId: '<SITE_ID>', branch: 'staging',});The API can also pass a different site in the same project as siteId, which moves the domain to that site. See Rule updates in the Proxy API reference for every update method.
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.