How to Create a Subdomain in cPanel?
This guide walks you through creating a subdomain in cPanel, from logging in via the client area to configuring DNS and enabling HTTPS. You'll learn whether to share files with your parent domain or give the subdomain its own directory, and how to troubleshoot common issues.
Go to cPanel, open Domains, select Create a New Domain, enter the subdomain as sub.example.com, choose the document root option you want, then create it. If your DNS is not hosted on the same cPanel server, add A and AAAA records for the subdomain at your DNS provider so it points to your hosting IP.
Before you start
- You can log in to cPanel for the hosting plan via our client area.
- You know where your domain’s DNS is hosted. If it is external, have access to add records.
- Decide if the subdomain should serve separate files or the same content as the parent site.
Step 1: Log in to cPanel from your Hostworld client area
This uses WHMCS Single Sign On. It takes you straight into cPanel without a separate password.
- Go to https://portal.hostworld.uk and sign in.
- Open your hosting service, then use Login to cPanel. If you see an SSO error, see If it does not work below.
Step 2: Create the subdomain in cPanel
This adds the hostname to your account and sets where its files live.
- In cPanel, open Domains.
- Select Create a New Domain.
- Enter the full subdomain, for example blog.example.com. cPanel auto fills the Subdomain and Document Root fields. You can override them.
- Choose if it should Share document root with example.com. Leave this ticked to serve the same files as the parent site. Untick it to give the subdomain its own directory.
- Confirm to create.
Undo this: go back to Domains, find the subdomain, choose Manage, then Remove. This removes the mapping and any related entries the account manages. It does not delete files in the document root by design. Remove leftover files in File Manager if you want them gone.
Step 3: Point DNS to the server
This makes the subdomain resolve to your hosting so browsers reach the right place.
- If your domain’s DNS is on this cPanel server: cPanel will add the DNS record. Check in cPanel, Zone Editor. Confirm there is an A record for blog.example.com. If you add records manually in Zone Editor, use the full name, for example blog.example.com. with a trailing dot.
- If your DNS is elsewhere: at your DNS provider, add A (and AAAA if you use IPv6) for the subdomain, pointing to your cPanel server IP. AutoSSL needs the hostname to resolve to this server.
DNS updates can take up to 48 hours to propagate. Lower the TTL a day before changes if you plan ahead.
Step 4: Secure it with AutoSSL, then force HTTPS if you want
This issues a certificate and redirects HTTP to HTTPS.
- In cPanel, open SSL/TLS Status. Select Run AutoSSL. It will only succeed if the subdomain already resolves to this server and the DCV check passes.
- Back in Domains, use Force HTTPS Redirect for the subdomain to send visitors to HTTPS. The toggle is disabled if there is no valid SSL. Turn the toggle off to undo the redirect.
Step 5: Remove the subdomain if you need to revert
- In cPanel, open Domains, select Manage next to the subdomain, then Remove.
- Clean up files in its document root via File Manager if you no longer need them.
- If the subdomain had its own email accounts, they will disappear from Email Accounts when you remove the domain.
If it does not work
- New subdomain does not load or loads the wrong server: check DNS. If you use external DNS, add or correct A and AAAA records. An off server AAAA causes AutoSSL and browsing to fail even if A is correct. Fix the IPv6 or remove it.
- You see the parent site’s content: you created it with Share document root on. In cPanel, Domains, Manage the subdomain and change its document root, or recreate it with its own directory. Changing the root can break application paths. Back up first.
- You cannot find Subdomains in cPanel: use Domains instead. The legacy Subdomains page was removed. Create and manage subdomains under Domains.
Still stuck or unable to log in via the client area SSO? Please open a support ticket and we will check the account and DNS for you.
What next
If you run your sites on a VPS and manage your own DNS or cPanel server, you may want deeper control. See our VPS guides. Planning to move the site or scale up later today? Review our UK plans at Linux VPS.
Common questions
Will removing a subdomain delete email or files?
Removing it in Domains removes the mapping and any zone entries managed by the account. Mailboxes that use that domain will disappear from Email Accounts because the domain is gone. Files in the document root are not deleted. Remove them in File Manager if you want a clean slate.
Can I create a wildcard subdomain, for example *.example.com?
Yes. Add *.example.com in Domains, then add a matching wildcard DNS record. If DNS is not on the cPanel server, create the wildcard at your external DNS provider. For wildcard certificates, AutoSSL usually needs DNS validation, which only works when the cPanel server is authoritative for the zone.
Can I place the subdomain outside public_html or change the document root later?
You can change the document root in Domains, Manage. Be aware that moving it can break application paths. Some servers restrict roots to public_html. If you cannot choose a path outside public_html, that policy is enforced by the server. If you need an exception, open a support ticket.
Was this article helpful?
0 people found this helpful