# Add Custom Domains


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Background

By default, when you first deploy a Plash app, it automatically receives
a randomized Plash subdomain (like
`https://your-fasthtml-app-83k.pla.sh`).

On this page you will learn how to customize your app’s domain in two
ways:

1.  Custom pla.sh subdomain
2.  Bring your own domain

## Custom pla.sh subdomain

When you deploy a Plash app for the first time, a `.plash` file is
created in your project root directory. This file contains your app’s
configuration, including the app name which determines your subdomain:

``` bash
export PLASH_APP_NAME='my-awesome-app-83k'
```

To customize your Plash subdomain:

1.  Open the `.plash` file in your project directory
2.  Edit the `PLASH_APP_NAME` value to your preferred subdomain name
3.  Redeploy your app with `plash_deploy`
4.  Go to the dashboard to delete your old app or use
    `plash_delete --name <old_name>`

``` bash
# Example .plash file with custom app name
export PLASH_APP_NAME='my-awesome-app'
```

Your custom subdomain must follow these rules:

- Start with a lowercase letter (a-z)
- Contain exactly 3-4 hyphen-separated words
- Each word: 1-15 characters using only lowercase letters (a-z) and
  digits (0-9)
- Examples: happy-tiger-runs, clever-ocean-builds-x7k

<div>

> **Tip**
>
> You cannot choose a `PLASH_APP_NAME` that has been taken by another
> user. If you do, you’ll receive an error when you run plash_deploy.

</div>

## Using Your Own Custom Domain

To use your own domain with your Plash app:

1.  Open the `.plash` file in your project directory
2.  Replace the `PLASH_APP_NAME` value with your full domain name
3.  Set up DNS to point to `pla.sh` (see below)
4.  Redeploy your app with `plash_deploy`

``` bash
# Example .plash file with custom domain
export PLASH_APP_NAME='myapp.example.com'
```

### Setting Up DNS

**For subdomains** (e.g., `app.example.com`): Create a CNAME record
pointing to `pla.sh`.

**For apex/root domains** (e.g., `example.com`): Standard CNAME records
won’t work. You need a provider that supports CNAME flattening or ALIAS
records:

<table>
<thead>
<tr>
<th>Provider</th>
<th>Record Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cloudflare</td>
<td>CNAME (auto-flattened at apex)</td>
</tr>
<tr>
<td>AWS Route 53</td>
<td>ALIAS</td>
</tr>
<tr>
<td>Azure DNS</td>
<td>Alias</td>
</tr>
<tr>
<td>DNS Made Easy</td>
<td>ANAME</td>
</tr>
<tr>
<td>DNSimple</td>
<td>ALIAS</td>
</tr>
<tr>
<td>Namecheap</td>
<td>ALIAS</td>
</tr>
<tr>
<td>Porkbun</td>
<td>ALIAS</td>
</tr>
</tbody>
</table>

<div>

> **Tip**
>
> We recommend **Cloudflare** for DNS—just create a CNAME at the apex
> and it handles flattening automatically.

</div>

<div>

> **Warning**
>
> GoDaddy does not support CNAME flattening. Use a subdomain or switch
> DNS providers.

</div>

DNS changes can take up to 48 hours to propagate, though they often take
effect much sooner.

## Verifying Your Custom Domain

After setting up your custom domain and redeploying your app, you can
verify it’s working by:

1.  Running `plash_view` to open your app in the browser
2.  Checking that your app loads correctly at your custom domain
