> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/stormkit-io/stormkit-io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Domains

> Configure custom domains for your Stormkit deployments with automatic SSL certificates.

## Overview

Stormkit allows you to configure custom domains for your environments, giving your applications a professional, branded URL. Each domain comes with automatic SSL certificate provisioning via Let's Encrypt.

## Adding a Custom Domain

<Steps>
  <Step title="Navigate to Custom Domains">
    Visit your **Environment** > **Config** > **Other** > **Custom Domains**
  </Step>

  <Step title="Add domain">
    Click the **Add Domain** button and enter your domain name (e.g., `example.com` or `www.example.com`)
  </Step>

  <Step title="Verify domain">
    Add the provided DNS records to your domain's DNS configuration:

    * **A Record**: Point to Stormkit's IP address
    * **TXT Record**: For domain verification (if required)
  </Step>

  <Step title="Wait for verification">
    Once the DNS records propagate, Stormkit will automatically verify your domain and issue an SSL certificate.
  </Step>
</Steps>

## Domain Configuration

<CardGroup cols={2}>
  <Card title="Automatic SSL" icon="lock">
    SSL certificates are automatically issued and renewed via Let's Encrypt for all verified domains.
  </Card>

  <Card title="Custom Certificates" icon="certificate">
    Upload your own SSL certificates if you prefer to use custom TLS certificates. [Learn more](/features/custom-certificates)
  </Card>

  <Card title="Multiple Domains" icon="globe">
    Add multiple domains to the same environment. All domains will serve the same deployment.
  </Card>

  <Card title="WWW and Non-WWW" icon="arrows-left-right">
    Configure both `example.com` and `www.example.com` and set up redirects between them.
  </Card>
</CardGroup>

## Domain Verification

For cloud-hosted Stormkit:

1. Add the TXT record with the provided token
2. Wait for DNS propagation (can take up to 48 hours)
3. Stormkit automatically verifies the domain

<Info>
  For self-hosted users, domain verification is always set to `true` automatically.
</Info>

## DNS Configuration Examples

### Root Domain (example.com)

```dns theme={null}
Type: A
Name: @
Value: [Stormkit IP Address]
```

### Subdomain ([www.example.com](http://www.example.com))

```dns theme={null}
Type: A
Name: www
Value: [Stormkit IP Address]
```

### Verification TXT Record

```dns theme={null}
Type: TXT
Name: _stormkit-verify
Value: [Your verification token]
```

## Managing Domains

For each configured domain, you can:

<AccordionGroup>
  <Accordion title="View domain status">
    Check if the domain is verified and has a valid SSL certificate.
  </Accordion>

  <Accordion title="Update custom certificate">
    Upload a custom SSL certificate and private key in PEM format. See [Custom Certificates](/features/custom-certificates) for details.
  </Accordion>

  <Accordion title="Delete domain">
    Remove a domain from your environment. The SSL certificate will be automatically cleaned up.
  </Accordion>
</AccordionGroup>

## Redirecting Between Domains

Use the `redirects.json` file to redirect between www and non-www versions:

```json theme={null}
[
  {
    "from": "example.com",
    "to": "www.example.com",
    "assets": true,
    "status": 301
  }
]
```

Learn more about [Redirects and Path Rewrites](/features/redirects-and-path-rewrites).

## API Access

You can manage domains programmatically using the Stormkit API:

* `POST /v1/domains` - Add a new domain
* `GET /v1/domains` - List all domains
* `DELETE /v1/domains` - Remove a domain
* `PUT /v1/domains/cert` - Update custom certificate
* `DELETE /v1/domains/cert` - Remove custom certificate

See the [Domains API documentation](/api/domains) for details.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Domain not verifying">
    * Check that DNS records are correctly configured
    * Wait for DNS propagation (can take up to 48 hours)
    * Verify there are no conflicting DNS records
    * Use `dig` or `nslookup` to verify DNS propagation
  </Accordion>

  <Accordion title="SSL certificate errors">
    * Ensure the domain is verified first
    * Check that your domain points to the correct IP address
    * Wait for automatic certificate issuance (can take a few minutes)
  </Accordion>

  <Accordion title="Multiple domains showing different content">
    All domains on the same environment serve the same deployment. Use [Snippets](/features/snippets) to customize content per domain.
  </Accordion>
</AccordionGroup>
