Creating a subdomain in cPanel is a simple way to organize your website and create separate sections or new websites under your main domain. This guide will show you how to create a subdomain using cPanel in easy steps.
What is a Subdomain?
A subdomain is a prefix added to your main domain name, allowing you to create separate sections of your website. For example, if your main domain is example.com
, a subdomain could be blog.example.com
or shop.example.com
.
Steps to Create a Subdomain in cPanel
-
Log in to Your cPanel Account
Open your web browser and go to your cPanel login page. This is usually at
https://yourdomain.com:2083
orhttps://yourdomain.com/cpanel
. Enter your username and password to log in. -
Locate the Subdomains Option
Once you're logged in, scroll down to the Domains section. Click on the Subdomains icon.
-
Create a New Subdomain
In the Subdomains page:
- Find the Create a Subdomain section.
- In the Subdomain field, type the name you want for your subdomain (e.g.,
blog
). - Select your main domain from the dropdown menu next to it.
- The Document Root field will automatically fill in. This is the directory where files for the subdomain will be stored. You can leave it as is or change it if needed.
- Click on the Create button.
A confirmation message will appear, indicating that your subdomain has been created.
-
Upload Content to Your Subdomain
Now that your subdomain is created, you can add content to it:
- Go back to the cPanel main page.
- Click on the File Manager icon in the Files section.
- In the File Manager, navigate to the folder named after your subdomain (e.g.,
public_html/blog
). - Upload your website files to this folder.
-
Test Your Subdomain
Open a new browser tab and go to your subdomain URL (e.g.,
http://blog.example.com
) to see if it's working correctly.
Conclusion
Creating a subdomain through cPanel is straightforward. It allows you to organize your website better and even host multiple websites under the same main domain. Follow these simple steps to set up your subdomain and start adding content to it.
Frequently Asked Questions
Can I create multiple subdomains?
Yes, you can create multiple subdomains. Just repeat the steps above for each subdomain you want to create.
Do subdomains affect my main website?
No, subdomains are separate from your main website. Changes in a subdomain do not affect the main domain.
Do I need to update DNS settings?
Usually, cPanel will handle DNS settings automatically. However, if you're using external DNS providers, you may need to add an A
record for your subdomain pointing to your server's IP address.