Add Custom Domains
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:
- Custom pla.sh subdomain
- 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:
export PLASH_APP_NAME='my-awesome-app-83k'
To customize your Plash subdomain:
- Open the
.plash
file in your project directory - Edit the
PLASH_APP_NAME
value to your preferred subdomain name - Redeploy your app with
plash_deploy
- Go to the dashboard to delete your old app or use
plash_delete --name <old_name>
# 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
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.
Using Your Own Custom Domain
To use your own domain with your Plash app:
- Open the
.plash
file in your project directory - Replace the
PLASH_APP_NAME
value with your full domain name - Set up a CNAME record with your DNS provider pointing to
pla.sh
- Redeploy your app with
plash_deploy
# Example .plash file with custom domain
export PLASH_APP_NAME='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
- Log in to your Cloudflare dashboard
- Select your domain
- Go to the DNS tab
- 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
- Log in to your Namecheap account
- Go to Domain List and click “Manage” next to your domain
- Navigate to the “Advanced DNS” tab
- 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.
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:
- Running
plash_view
to open your app in the browser - Checking that your app loads correctly at your custom domain