Add Custom Domains

How to add custom domains

Background

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

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

  1. Customizing your pla.sh subdomain
  2. Using your own custom domain

Customizing Your Plash 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 ID which determines your subdomain:

export PLASH_APP_ID='fasthtml-app-r4nd0mstr1ng'

To customize your Plash subdomain:

  1. Open the .plash file in your project directory
  2. Edit the PLASH_APP_ID value to your preferred subdomain name
  3. Redeploy your app with plash_deploy
# Example .plash file with custom app ID
export PLASH_APP_ID='my-awesome-app'
Tip

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

Warning

When choosing a custom subdomain, avoid using periods (.) in the name, as Plash uses this to distinguish between subdomains and custom domains.

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_ID value with your full domain name
  3. Set up a CNAME record with your DNS provider pointing to pla.sh
  4. Redeploy your app with plash_deploy
# Example .plash file with custom domain
export PLASH_APP_ID='myapp.example.com'

Setting Up DNS Records

You’ll need to create a CNAME record with your DNS provider that points your domain to pla.sh. Here are quick guides for popular DNS providers:

Cloudflare

  1. Log in to your Cloudflare dashboard
  2. Select your domain
  3. Go to the DNS tab
  4. Add a CNAME record:
    • Type: CNAME
    • Name: Your subdomain (or @ for root domain)
    • Target: pla.sh
    • TTL: Auto

For detailed instructions, see the Cloudflare DNS setup guide.

Namecheap

  1. Log in to your Namecheap account
  2. Go to Domain List and click “Manage” next to your domain
  3. Navigate to the “Advanced DNS” tab
  4. Add a CNAME record:
    • Type: CNAME Record
    • Host: Your subdomain (or @ for root domain)
    • Value: pla.sh
    • TTL: Automatic

For detailed instructions, see the Namecheap CNAME setup guide.

Note

DNS changes can take up to 48 hours to propagate fully, 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