Logo
Bearhost Logo

How to Create Subdomains

By Elliot, BearHost·

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

  1. Log in to cPanel
  2. Click Subdomains in the Domains section
  3. Enter the subdomain name (e.g., "blog")
  4. Select the domain
  5. The document root auto-fills (you can change it)
  6. 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

  1. Click Manage next to the subdomain
  2. Change the document root
  3. Click Save

Delete a Subdomain

  1. Click Remove next to the subdomain
  2. 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