Adding a custom domain

Connect your own domain (like acme.com or www.acme.com) to your PlayCode project. Your website will be accessible at your custom domain instead of projectname.playcode.io.

Note: Custom domains is a Pro feature. You'll see a purple "PRO" badge next to the custom domains section. Free users will be prompted to upgrade.

Requirements

  • Pro account (paid subscription required)
  • Your project must be published
  • You must own a domain from a domain registrar (GoDaddy, Namecheap, Cloudflare, etc.)

Step 1: Configure DNS Settings (Do This First!)

⚠️ Important: Configure DNS BEFORE adding the domain in PlayCode. This allows immediate validation and faster SSL generation.

Go to your domain registrar (where you bought the domain) and configure DNS. The configuration is different for root domains vs subdomains:

For Root Domain (e.g., acme.com)

Field Value
TypeCNAME
Name/Host@ (represents root domain)
Value/Targetapp.playcode.io

For Subdomain (e.g., www.acme.com, blog.acme.com)

Field Value
TypeCNAME
Name/Hostwww or blog (your subdomain name)
Value/Targetapp.playcode.io

Provider-Specific Instructions

GoDaddy
  1. Log in to GoDaddy and go to My Products
  2. Click DNS next to your domain
  3. Click Add button in the Records section
  4. Select Type: CNAME
  5. In Name field: Enter @ (root) or subdomain name (e.g., www)
  6. In Value field: Enter app.playcode.io
  7. TTL: Leave default or set to 1 hour
  8. Click Save
Namecheap
  1. Log in to Namecheap and go to Domain List
  2. Click Manage next to your domain
  3. Go to Advanced DNS tab
  4. Click Add New Record
  5. Select Type: CNAME Record
  6. In Host field: Enter @ (root) or subdomain name (e.g., www)
  7. In Value field: Enter app.playcode.io
  8. Click the green checkmark to save
Cloudflare
  1. Log in to Cloudflare and select your domain
  2. Go to DNS section
  3. Click Add record
  4. Select Type: CNAME
  5. In Name field: Enter @ (root) or subdomain (e.g., www)
  6. In Target field: Enter app.playcode.io
  7. CRITICAL: Click the orange cloud to turn it gray (Proxy status: DNS only)
  8. Click Save
⚠️ Important: Cloudflare proxy (orange cloud) must be disabled. When proxying is enabled, SSL certificate generation will fail. The cloud icon must be gray (DNS only).

Step 2: Add Domain in PlayCode

After configuring DNS (and waiting 5-10 minutes for propagation), add the domain in PlayCode:

  1. Open your project in the PlayCode editor
  2. Click the Publish button at the top right
  3. Scroll down to the Custom Domains section
  4. Click Add custom domain
  5. Enter your domain name (exactly as you configured in DNS):
    • If you configured root: acme.com
    • If you configured subdomain: www.acme.com, blog.acme.com, etc.
  6. Click Add
⚠️ Common Mistake: Do NOT enter your project name! Only enter the domain name.
  • ✅ Correct: acme.com, www.acme.com
  • ❌ Wrong: my-project, 3w, https://acme.com

What Happens After Adding Domain

1. Validation (Within 1 minute)

PlayCode automatically validates that your DNS is configured correctly by checking if your domain returns the validation file. This happens immediately after adding the domain.

2. HTTP Access (Immediate)

If DNS was configured correctly, your website will be accessible via HTTP right away:

  • http://acme.com ✅ Works immediately
  • You can test your website right away using HTTP

3. HTTPS/SSL Generation (1-2 hours)

PlayCode automatically generates a free SSL certificate from Let's Encrypt:

  • Happens automatically - no action needed from you
  • Takes 1-2 hours on average (sometimes up to 24 hours)
  • Once complete: https://acme.com ✅ Works with secure SSL
  • You'll be able to access your site securely
Tip: If HTTPS isn't working after 2 hours, double-check:
  • DNS is pointing to app.playcode.io (not an IP address)
  • Cloudflare proxy is disabled (gray cloud, not orange)
  • HTTP version (http://yourdomain.com) works first

Common Issues & Solutions

❌ "Domain not valid" error

  • Make sure you're entering just the domain: acme.com
  • Don't enter your project name or any other text
  • Correct: mysite.com, www.mysite.com
  • Wrong: my-project, https://mysite.com

❌ HTTPS not working after 2+ hours

  • If using Cloudflare: Turn OFF proxy (orange cloud → gray cloud)
  • Check DNS: CNAME must point to app.playcode.io, not an IP address
  • Verify HTTP works first: Test http://yourdomain.com

❌ HTTP isn't working

  • Wait 30 minutes for DNS propagation
  • Verify CNAME points to app.playcode.io
  • For root domain (acme.com): Name field must be @

DNS Propagation Time (Important!)

After configuring DNS in Step 1, you should wait 5-10 minutes before adding the domain in PlayCode (Step 2). DNS changes need time to propagate:

  • Usually: 5-30 minutes
  • Sometimes: 1-2 hours
  • Rarely: Up to 24 hours (depends on DNS provider)

You can add the domain in PlayCode before full propagation completes, but validation will be faster if you wait 5-10 minutes first.

Need more help?

Can't find what you're looking for? Chat with us or send us an email.