Custom Domains

Connect your own domain to any ZeroDeploy site with automatic SSL certificates.

Overview

Custom domains allow you to serve your deployed sites from your own domain (e.g., www.example.com) instead of the default *.zerodeploy.app subdomain.

The setup process is a single step: add a CNAME record pointing to zerodeploy.app. ZeroDeploy detects the CNAME and automatically verifies ownership and provisions SSL.

Quick Start

Here's the complete workflow to add a custom domain:

bash
# Step 1: Add the domain
zerodeploy domain add www.example.com

# Step 2: Add the CNAME record to your DNS (shown in output)
# CNAME → zerodeploy.app

# Step 3: Verify (or wait — the dashboard auto-detects it)
zerodeploy domain verify www.example.com

# Your site is now live at https://www.example.com

domain add

Add a custom domain to a site. This initiates the verification process.

zerodeploy domain add <domain> [options]

ArgumentDescription
domainThe domain to add (e.g., www.example.com or example.com)
OptionDescription
--site <site>Site (defaults to config/env)
bash
zerodeploy domain add www.example.com

domain verify

Verify domain ownership by checking that the CNAME record points to zerodeploy.app. The dashboard auto-polls, so this is optional.

zerodeploy domain verify <domain> [options]

OptionDescription
--site <site>Site (defaults to config/env)
--jsonOutput as JSON for scripting
bash
zerodeploy domain verify www.example.com

domain list

List all custom domains configured for a site.

zerodeploy domain list [options]

OptionDescription
--site <site>Site (defaults to config/env)
--jsonOutput as JSON for scripting
bash
zerodeploy domain list

domain remove

Remove a custom domain from a site.

zerodeploy domain remove <domain> [options]

OptionDescription
--site <site>Site (defaults to config/env)
bash
zerodeploy domain remove www.example.com

domain redirect

Set redirect mode for a custom domain. This allows automatic redirects between www and root (non-www) domains.

zerodeploy domain redirect <domain> --mode <mode> [options]

OptionDescription
--site <site>Site (defaults to config/env)
--mode <mode>Redirect mode: none, www_to_apex, or apex_to_www
--jsonOutput as JSON for scripting

Redirect Modes

bash
# Redirect www.example.com to example.com
zerodeploy domain redirect example.com --mode www_to_apex

# Redirect example.com to www.example.com
zerodeploy domain redirect www.example.com --mode apex_to_www

# Disable redirects
zerodeploy domain redirect example.com --mode none

DNS Configuration Guide

Subdomains (www.example.com)

For subdomains like www, app, or docs, add a standard CNAME record:

text
Type:   CNAME
Name:   www (or your subdomain)
Target: your-site.zerodeploy.app

Root Domains (example.com)

Root domains require special handling since DNS doesn't officially support CNAME records at the root level.

If using Cloudflare (Recommended)

Cloudflare supports CNAME flattening, which allows CNAME records at the root:

text
Type:   CNAME
Name:   @ (or example.com)
Target: your-site.zerodeploy.app
Proxy:  ON (orange cloud)

SSL Certificates

ZeroDeploy automatically provisions SSL certificates for verified custom domains through Cloudflare. No manual configuration is required.