How to Create a Subdomain in cPanel Print

  • subdomain, cpanel
  • 86

How to Create a Subdomain in cPanel

Applies to the current cPanel Domains interface (the modern replacement for the older “Subdomains” page).

Last updated: 20 August 2025

A subdomain is a prefix added to your main domain name (for example, blog.example.com). Use cPanel’s Domains tool to create a subdomain and choose where its files live.

Before you start

  • You can log in to the cPanel account that owns the parent domain (e.g. example.com).
  • You know where your DNS is hosted (this server vs an external DNS provider like your registrar or Cloudflare).
  • You have the server’s IP address if your DNS is external.

Create the subdomain

  1. Log in to cPanel.
  2. Open Domains → click Create a New Domain.
  3. In Domain, enter your subdomain, e.g. blog.example.com.
  4. Untick Share document root if you want the subdomain to have its own folder (recommended).
    cPanel will suggest a Document Root (often /home/username/blog.example.com). You can change it (e.g. /public_html/blog) if you prefer the subdomain to live under your main site’s folder.
  5. Click Submit.
Note: Some hosts still show a legacy Subdomains icon. Either path works; the modern, supported path is Domains → Create a New Domain.

Point DNS to your server

Whether DNS changes are needed depends on where your DNS is hosted:

  • DNS on this server (default cPanel DNS): cPanel adds the A record automatically. No further action is needed.
  • External DNS (registrar, Cloudflare, etc.): add an A record for the subdomain:
    • Name/Host: blog (or blog.example.com depending on your DNS UI)
    • Type: A
    • Value: Your server’s IPv4 address (add an AAAA record if using IPv6)
    • TTL: 300–3600 seconds is typical

DNS propagation is usually quick but can take up to a few hours depending on TTL and resolver caching.

Upload your website files

  1. In cPanel, open File Manager.
  2. Browse to the subdomain’s Document Root you set above.
  3. Upload or publish your site files there. Ensure there’s an index.php or index.html.

SSL (HTTPS) with AutoSSL

Most cPanel servers run AutoSSL, which will automatically request and install an SSL certificate for your new subdomain once DNS resolves to the server. This can take a few minutes.

  • To check status, look under SSL/TLS Status in cPanel (or ask your provider to check AutoSSL logs in WHM).
  • If the subdomain is excluded from AutoSSL or doesn’t resolve to this server, a certificate won’t be issued.
Heads up: Wildcard subdomains (e.g. *.example.com) require special validation and are not issued by standard AutoSSL on most servers. Use specific subdomains like blog.example.com for automatic SSL.

Verify everything works

  1. Visit https://your-subdomain.example.com/.
  2. If you see a default page, upload an index file to the Document Root you chose.
  3. If you get a DNS/SSL error, re-check DNS records and wait for propagation, then re-run AutoSSL if needed.

Manage or remove the subdomain

  • Go to Domains and click Manage next to the subdomain to adjust its document root or set a redirect.
  • To remove it, click Remove Domain in the same screen.
    Removing a domain does not automatically delete its files; back up anything you need before cleaning up the folder.

Troubleshooting

My subdomain shows the main site (wrong content)
  • Check that Share document root was unticked when you created it.
  • Confirm the Document Root path under Domains → Manage and move your files there if needed.
DNS looks correct but the site won’t load
  • Clear your browser & DNS cache, or test from another network (or use a DNS checker).
  • Ensure there’s an index file in the subdomain’s document root.
  • If using a CDN/proxy (e.g. Cloudflare), make sure the record is proxied or DNS-only as required by your setup.
SSL padlock missing
  • Wait 5–15 minutes then check SSL/TLS Status in cPanel.
  • Make sure the subdomain’s DNS A/AAAA records point to this server.
  • Ask your host to re-run AutoSSL if it didn’t issue automatically.

 


Was this answer helpful?

« Back