Skip to main content

How to create a subdomain (subdomain) in cPanel

Use subdomains in cPanel to create your own subdomains for your website. This guide shows how to create a subdomain, connect it to a folder and make it ready for use.

Overview

A subdomain is an extension of your main domain and acts as a separate part of the website.

Examples of subdomains:

blog.example.com 
shop.example.com
customerportal.example.com

Subdomains are often used for:

  • Blogs

  • Online stores

  • Test environments

  • Customer portals

  • Documentation pages

When you finish this guide, you will know how to create and manage subdomains in cPanel.


Important information

⚠️ A subdomain depends on the main domain and cannot exist without it.

⚠️ cPanel normally creates a separate document root for each subdomain.

This allows you to keep the content separate from the main website.


Prerequisites

Before you start, make sure you:

  • Have access to cPanel

  • Are logged into cPanel

  • Have an active domain linked to the hosting account

  • Have a hosting package that supports subdomains


Step 1: Log in to cPanel

If your hosting service supports direct login to cPanel, you can log in via the client area.

This is how you do it:

  • Find your hosting service under active products/services

  • Click on Log in on cPanel

  • You are now automatically logged into cPanel


Step 2: Open Domains

Go to the Domains section and click on Domains


Step 3: Create a new subdomain

Click on Create A New Domain

  1. Select Registered Domain

  2. Enter the subdomain you want to create

In this example, we create the subdomain blog.getmeasandwich.com.

⚠️ Make sure you enter the entire subdomain including the main domain.

3. Select document root

The document root is the folder that contains the files of the site.

⚠️ Make sure you uncheck the Share document root checkbox

Otherwise, the subdomain will point to the same folder as the main domain, and display the same content.

When creating the subdomain, cPanel will suggest a document root:

/public_html/blog.getmeasandwich.com

💡 Tip: We recommend using the suggested folder unless you have a specific reason to choose a different location.

4. Click on Submit

The system now creates the subdomain and associated folder.

When the process is completed, the subdomain appears in the domain overview:

You can now upload files to the subdomain's folder, and these become visible in your browser.


Troubleshooting

The subdomain cannot be created

Make sure that:

  • The main domain is active in the hosting account

  • The hosting package supports subdomains

  • The subdomain name is not already in use

The subdomain shows an empty page

Make sure that:

  • There's an index file in the document root

  • The website's files are uploaded correctly

  • The files are in the correct folder

I'm getting a DNS error

Make sure that:

  • The main domain points to the correct server

  • DNS zone is correctly configured

DNS changes can take up to 24-48 hours to be updated globally.

The subdomain loads the main site

This is often because the document root points to the wrong folder.

Check the document root in your domain settings and make sure the subdomain has its own folder.


Summary

You have now learned how to create a subdomain in cPanel.

By using subdomains, you can create separate sections, websites, or test environments under your main domain, while keeping the content organized into your own folders.

Did this answer your question?