Subdomains let you create separate sections of your website with their own content.
What is a Subdomain?
A subdomain is a prefix added to your domain:
- blog.yoursite.com
- shop.yoursite.com
- support.yoursite.com
Each subdomain can have its own website, application, or purpose.
Create a Subdomain
- Log in to cPanel
- Click Subdomains in the Domains section
- Enter the subdomain name (e.g., "blog")
- Select the domain
- The document root auto-fills (you can change it)
- Click Create
Document Root
The document root is where the subdomain's files live:
- Default: public_html/blog
- Custom: public_html/myblog or any folder you choose
Files in this folder appear at blog.yoursite.com.
Use Cases
Separate Blog
- Subdomain: blog.yoursite.com
- Install WordPress in the blog folder
E-commerce Store
- Subdomain: shop.yoursite.com
- Install WooCommerce or Shopify
Staging Site
- Subdomain: staging.yoursite.com
- Test changes before going live
Support Portal
- Subdomain: support.yoursite.com
- Help desk or documentation
Multiple Languages
- Subdomain: es.yoursite.com (Spanish)
- Subdomain: fr.yoursite.com (French)
Manage Subdomains
Edit Document Root
- Click Manage next to the subdomain
- Change the document root
- Click Save
Delete a Subdomain
- Click Remove next to the subdomain
- Confirm deletion
Note: Deleting a subdomain doesn't delete the files in its folder.
SSL for Subdomains
Let's Encrypt automatically covers subdomains. Run AutoSSL after creating a subdomain to ensure HTTPS works.
Tips
- Keep subdomain names short and descriptive
- Use consistent naming conventions
- Each subdomain can have its own email accounts
- Subdomains can have separate analytics tracking
Tags:#cpanel#subdomain#domain#setup