Articles on: Domains & DNS

How To Create A Subdomain In cPanel

The ease of setting up subdomains is one of the most powerful features of cPanel.

With just a couple of clicks you can have a subdomain activated, with a fresh copy of WordPress, and even a valid SSL certificate.

Recently we've had some questions on how to modify these, including deleting them, so I figured I'd make a little guide to help everyone out.

Check DNS Records



Before getting started, are you using NameHero dns servers or external dns servers? It's important to perform a DNS Check using our free DNS Hero tool. If using NameHero dns servers you are good to go and everything will provision correctly. If you are using external dns servers, like CloudFlare, you will need to duplicate the new dns records in your external dns provider for it to work.

How To Create A Subdomain



Once you're certain your DNS records are all set, you need to follow these simple steps to add the subdomain:

Login to cPanel
Navigate to the Domains icon




Click Create A New Domain



Create the Subdomain (this example, I'm using my own personal domain here at NameHero:




The document root is the folder where all the files will live. I recommend keeping this default as it will place all the files just above your public_html directory of your main website.

Once you click Create it may take up to 24 hours for the DNS records to fully propagate. Most of the time it only takes a few hours in the United States, but if you don't see it active right away, that's why.

You can also see this article: How To Speed Up DNS Propagation to try and speed up this process.

How To Install WordPress



If you're wanting to install WordPress on the subdomain, the easiest way is to navigate WordPress under the Softaculous apps installer in cPanel:

Login to cPanel
Click on WordPress under Softaculous Apps Installer
Click Install Now
Under "Choose Installation URL" select the subdomain you just created
Continue installing WordPress per the directions provided on the screen

How To Setup SSL On Your Subdomain





If you just setup your subdomain it's possible the SSL certificate hasn't automatically installed. For this to happen, the DNS records must be propagated so the Let's Encrypt module can verify domain identification.

If you'd like to manually try to run it, you can follow these steps:

Login to cPanel
Click SSL/TLS Status
Check the box next to the red beside the subdomain (as noted in the screenshot above)
Click Run AutoSSL

This will attempt to force run the AutoSSL module. It takes a few minutes to run, so just set and let it do its thing. If it fails, it's likely you need to wait another hour or two for the DNS to propagate. This process should be automated if waiting 24 hours or more.

How To Manually Add Files To Your Subdomain





If you don't want to install WordPress on your subdomain you can manually upload your files through an FTP program such as Transmit or Filezilla. The easiest way though is to do so through File Manager:

Login to cPanel
Click on File Manager (Files section)
Navigate to your subdomain's document root
Click the Upload link at the top
Upload your files

You can also manually create files by clicking + File or + Folder on the top menu. This is especially helpful if you're just wanting to create a basic HTML page.

How To Remove A Subdomain





Removing a subdomain is pretty easy, but there are a couple steps you need to take into consideration:

Login to cPanel
Click on Domains
Click on Manage beside the subdomain
Click the Remove Domain button as shown above
If you installed WordPress using Softaculous:

Go back to the main cPanel page
Click on WordPress under Softaculous Apps Installer
Under "My Apps" click the Red X to remove

If you manually installed your files:

Go to the main page of cPanel
Click on File Manager
Navigate to the document root of the subdomain
Delete the folder

That's it! Your subdomain has successfully been removed. It's important to remember, just deleting it inside of cPanel removes the DNS entries, but not the actual files/folders. I believe this is a security setting so you don't accidentally remove wanted files.

Updated on: 10/10/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!