New Customers: 50% OFF Your First Month on All VPS Servers & Web Hosting Plans!

Adding your first domain in the control panel

Add a website to your cPanel server by creating an account in WHM, uploading files to the document root, and configuring DNS. You can preview the site using a hosts file override before DNS changes take effect.

Rhys CallowayLinux VPS, servers, security and the command line 9 min read Updated 23 Sep 2026 AlmaLinux 9, Ubuntu 24.04

This picks up from a server you can already reach over SSH with cPanel & WHM installed. To add your first website, create a cPanel account for the domain in WHM, put the site files in the account’s document root, then point the domain’s DNS at the server. You can preview the site ahead of DNS propagation by using a hosts file override on your workstation.

Before you start

  • cPanel & WHM supports both AlmaLinux 9 and Ubuntu 24.04. AlmaLinux 9 appears in the official system requirements. Ubuntu 24.04 LTS is supported as well.
  • If you are running a RHEL 9 based operating system such as AlmaLinux 9 and your cPanel is v132 or later, you must be on OS version 9.5 or higher to install or upgrade cPanel.
  • Have the primary domain name you intend to host. Do not use the server’s hostname. WHM will block creating an account whose domain equals the server hostname.
  • Decide how you will handle DNS:
    • Use Hostworld DNS. Point the domain’s nameservers at Hostworld: ns1.serverworld.uk, ns2.serverworld.uk, ns3.serverworld.uk, ns4.serverworld.uk.
    • Keep DNS at your registrar or another provider. You will set A and AAAA records there to the server IP.
    • Run your own nameservers on this cPanel server. You must configure nameservers in WHM and register them at your domain registrar. The registrar step is outside cPanel.
  • Understand where files go. On cPanel, the primary domain’s document root is typically /home/username/public_html. Additional domains are managed in cPanel » Domains. Uncheck “Share document root…” when you want a separate site directory.
  • DNS changes can take time. cPanel’s documentation notes propagation may take up to a week. It is often quicker, but plan accordingly.
  • AutoSSL will not issue a certificate until the domain publicly resolves to this server. If validation fails with “does not resolve”, DNS is not pointed correctly yet. A stray AAAA record pointing elsewhere is a common cause of failures.
  • If you preview using mod_userdir, do it knowing the risks. Enabling mod_userdir weakens isolation and can cause content or HTTPS issues. Prefer a hosts file override on your own workstation.
  • Do not perform in‑place major OS upgrades with generic distro tools on a cPanel server. For supported transitions use cPanel’s ELevate project. Using other tools can break cPanel.

Step 1: Create a cPanel account for the domain in WHM

You add the first website by creating a cPanel account for the domain. This applies if you run your own cPanel server on a Hostworld VPS and also if you are a reseller in WHM.

  1. Log in to WHM as root or as a reseller with the required privileges.
  2. Open Create a New Account. In WHM this is Create a New Account under Account Functions.
  3. Enter the Domain. This must not be the server’s hostname.
  4. Set a Username and Password. WHM will suggest a username. Keep a note of it. It forms the home directory path and some default email names.
  5. Choose a Package if you use them, or set resource limits manually.
  6. Finish the form and create the account. WHM builds the virtual host, the system user and the DNS zone if you manage DNS on this server.

Result: you now have a cPanel login for this domain and a home directory at /home/username with a web root for the primary domain at /home/username/public_html.

Step 2: Put your website files in the right place

On a fresh account, the primary domain serves content from /home/username/public_html. This is the directory you upload to if you are publishing a single site for the account’s main domain.

  • You can add extra domains and subdomains later in cPanel » Domains. The older Addon Domains, Aliases and Subdomains menus were removed. Their functionality lives under Domains in the Jupiter theme.
  • When adding another domain in cPanel » Domains, uncheck “Share document root … with <main domain>” if you want this domain to have its own site directory. Leaving it checked means both domains will serve the same content, which is rarely what you want and can cause SEO and security confusion.
  • You can change an added domain’s document root later in cPanel » Domains » Manage. You cannot change the main domain’s document root.
  • If you have configured a domain to proxy to a web application in cPanel, Apache serves the app instead of files in the document root. Files you place in the document root will not be served until you remove or adjust the app mapping.

Create a quick holding page for testing

The following command writes a basic index.html into the primary domain’s document root so you can test the site is being served.

What the command does: it writes a short HTML snippet into /home/username/public_html/index.html, replacing any existing file of the same name.

AlmaLinux 9

echo '<!doctype html><title>It works</title><h1>It works</h1>' > /home/username/public_html/index.html

Ubuntu 24.04

echo '<!doctype html><title>It works</title><h1>It works</h1>' > /home/username/public_html/index.html

Replace username with the actual cPanel username you created in WHM.

Step 3: Decide where DNS will live and point the domain at the server

For the world to reach your new site, DNS for the domain must point to this server. Here are the supported routes and where to make the change.

Option A: Use Hostworld nameservers

  • At your domain registrar, set the domain’s nameservers to:
    • ns1.serverworld.uk
    • ns2.serverworld.uk
    • ns3.serverworld.uk
    • ns4.serverworld.uk
  • Then manage DNS records in cPanel for that domain. In cPanel, open Zone Editor to view and edit A, AAAA, CNAME, MX and other records.
  • Check the A record for the root domain and the www host. They should point to your server’s IPv4 address. If you also publish AAAA for IPv6, ensure it points to the server’s IPv6. If you do not use IPv6 yet, remove any stray AAAA records to avoid SSL validation issues.

Option B: Keep DNS at your registrar or another provider

  • Edit the domain’s DNS zone where it is hosted now. Set:
    • A record for the root domain to your server’s IPv4.
    • Either a CNAME for www pointing to the root domain, or an A record for www to the same IPv4.
    • If you publish IPv6, set the AAAA records to the server’s IPv6. If you do not, remove old AAAA records that point elsewhere. Stray AAAA records will cause AutoSSL validation to fail.
  • If you plan to host mail on this server, make sure MX and related records follow your mail plan. MX edits are also done in the same DNS zone. If you are unsure, open a support ticket and we will help you review them.

Option C: Run your own nameservers on this cPanel server

  • In WHM, set up nameservers for your server. The cPanel documentation covers the steps to configure nameservers in a cPanel environment.
  • Register those nameserver hostnames at your domain’s registrar. This requirement is outside cPanel and varies by registrar. The changes will not work until the registrar knows the nameserver hostnames and their IPs.
  • Once registered, set your domain to use your new nameservers. Manage the zone in WHM » DNS Zone Manager or in cPanel » Zone Editor, depending on your setup.

Step 4: Wait for DNS to propagate, but preview the site immediately

Nameserver and DNS changes can propagate slowly. cPanel’s documentation notes propagation may take up to a week, though it is commonly shorter. While you wait, you can test the site on your workstation without changing public DNS.

Preview using a hosts file override on your workstation

What this does: it tells your own computer to resolve the domain to your server’s IP, letting you browse and test the site without waiting for global DNS to update. It affects only your machine.

  • Follow the official cPanel guide “How to Modify Your Hosts File” for OS-specific steps. It shows how to add a line mapping your domain to the server IP and how to revert it afterwards.
  • Keep this entry only while testing. Remove it once public DNS is updated, or you may hide real DNS issues from yourself.

Alternative: mod_userdir preview

WHM can enable Apache’s mod_userdir Tweak so that http://server-ip/~username serves the account’s site. This is often disabled by default for security and performance reasons. If you enable it in WHM » Security Center » Apache mod_userdir Tweak, use it briefly to confirm content, then disable it again. Be aware it can expose content and cause mixed‑content or HTTPS issues.

Step 5: Verify AutoSSL and HTTPS once DNS points correctly

AutoSSL issues a certificate only after the domain publicly resolves to this server. If the certificate does not appear, check AutoSSL logs for Domain Control Validation failures such as “does not resolve”. That indicates DNS is not correctly pointed yet. If a domain has an AAAA record that points elsewhere, validation will also fail. Remove or fix the AAAA record, or align IPv6 on the server, then retry AutoSSL.

Step 6: Add more domains or subdomains to the same account

Use cPanel » Domains to add further domains. When you want each domain to serve its own site, uncheck “Share document root … with <main domain>” at creation time. You can change the document root of an added domain later in cPanel » Domains » Manage. You cannot change the main domain’s document root, so plan the account structure before large migrations.

Step 7: Be careful with destructive or structural changes

  • Do not click Terminate Account in WHM unless you intend to delete it. Termination permanently deletes the account’s home, databases, mailboxes and by default its DNS zone. Recovery requires backups.
  • Changing a cPanel account’s primary domain has side effects. WHM updates DNS and email usernames when you change it. The main domain remains locked to public_html. Plan mail mapping and file layout before changing.

AlmaLinux 9 and Ubuntu 24.04 notes and commands

There are not many shell commands involved in adding a site because cPanel & WHM is panel driven. Where you do run commands, here is how they look on both platforms.

Create or replace a quick test index.html

What this does: writes a small placeholder page so you can confirm the web server is serving from the expected document root.

AlmaLinux 9

echo '<!doctype html><title>Hello</title><h1>Hello from cPanel</h1>' > /home/username/public_html/index.html

Ubuntu 24.04

echo '<!doctype html><title>Hello</title><h1>Hello from cPanel</h1>' > /home/username/public_html/index.html

Remove the temporary test page later

What this does: deletes the temporary index.html you created so your real site can take over.

AlmaLinux 9

rm -f /home/username/public_html/index.html

Ubuntu 24.04

rm -f /home/username/public_html/index.html

Replace username with your cPanel username in all cases.

What next

  • If you are choosing where to run this, read about our UK location at Linux VPS. We host our own London network with the data centre in Maidenhead, Berkshire.
  • If you need wider context on server setup and upkeep, browse our VPS guides.
  • If you want a hand checking your DNS zone or an AutoSSL failure, please open a support ticket and we will review your domain and records.

The next step in the playbook: issue HTTPS with AutoSSL and set your preferred HTTP to HTTPS redirects.

Common questions

Can I use the server’s hostname as the first domain?

No. WHM will block you from creating a cPanel account whose domain matches the server’s hostname. Choose a different primary domain for the account.

Where do I upload my site files?

For the account’s primary domain, use /home/username/public_html. For additional domains you add in cPanel » Domains, uncheck “Share document root …” when you add them so they get their own directories. You can later change the document root for added domains in cPanel » Domains » Manage. You cannot change the main domain’s document root.

DNS is changed but the site has not moved yet. How long should I wait?

DNS changes can take time to propagate. cPanel’s documentation notes up to a week in some cases. Often it is much quicker. While you wait, preview with a hosts file override using cPanel’s “How to Modify Your Hosts File” guide. Remove the override once public DNS has caught up.

Why is AutoSSL failing?

AutoSSL requires the domain to resolve to this server for Domain Control Validation. Failures such as “does not resolve” indicate DNS is not pointing here yet. A common blocker is an AAAA record that points to a different IPv6 address. Remove or correct it, then retry AutoSSL.

Is there a risk to using mod_userdir for previews?

Yes. Enabling mod_userdir weakens isolation and can expose content or create mixed‑content and HTTPS problems. Prefer a hosts file override on your workstation. If you do turn on mod_userdir in WHM » Security Center » Apache mod_userdir Tweak, use it briefly and disable it again after testing.

What happens if I terminate an account in WHM by mistake?

Termination permanently deletes the account’s home directory, databases, mailboxes and by default its DNS zone. It cannot be undone without backups. If this has happened, open a support ticket straight away and tell us what backups you have.