How to Install WordPress on cPanel, a Domain or a Subdomain
Three routes: the one-click installer for speed, a manual install when you want control, and a subdomain install for staging. All three end at the same five-minute setup screen.
Fastest route: open cPanel, find the WordPress installer under Softaculous or "WordPress Toolkit", pick the domain, set an admin username that is not admin, and install. Five minutes, including the SSL certificate.
The manual route is below for the cases where the installer is not enough.
Before you install
Have these ready:
- the domain pointing at the host — check with
dig +short example.com; - an SSL certificate, usually issued automatically once DNS resolves;
- a PHP version supported by current WordPress, set in cPanel's PHP selector;
- an email address you actually read, since it receives the reset links.
If the domain does not yet resolve, install anyway and fix the URLs later — the constants are in wp-config.php explained.
Route 1: the cPanel one-click installer
- Log into cPanel and open the WordPress installer (Softaculous, Installatron or WordPress Toolkit depending on the host).
- Choose https:// as the protocol, and pick
wwwor non-wwwdeliberately — this becomes the canonical hostname. - Leave In Directory empty to install at the domain root. Enter a folder name only if you genuinely want the site under
/blog/or similar. - Set the site name and description; both are changeable later.
- Create an admin username that is not
admin, and a long unique password. - Enter a real admin email address.
- Install.
Afterwards, before doing anything else:
- open Settings → Permalinks and choose Post name;
- confirm Settings → Reading does not have search engine indexing discouraged;
- delete the sample post, sample page and any bundled plugins you did not ask for.
Route 2: manual install
Use this when you want a specific version, a custom directory layout, or the installer is unavailable.
Create the database. In cPanel, open MySQL Databases:
- Create a database.
- Create a user with a strong password.
- Add the user to the database with All Privileges.
- Write down all three values — database name, user, password. Host is usually
localhost.
Upload WordPress. Download the latest release, then either upload the zip through File Manager and extract it, or transfer the files over SFTP. Files belong in public_html for a root install.
Extract carefully: many archives unpack into a wordpress/ folder. If your site lands at example.com/wordpress/, move the contents up one level.
Run the installer. Visit the domain. WordPress asks for the database details, writes wp-config.php, and then asks for the site title and admin account.
If it cannot write the file, it shows the contents to copy. Create wp-config.php in the web root manually and paste them in, saving as UTF-8 without a byte-order mark.
Route 3: install on a subdomain
Subdomains are the cheapest way to run a staging copy.
- In cPanel, open Subdomains and create
staging.example.com. cPanel creates a document root, usuallypublic_html/staging. - Wait for DNS to resolve — usually immediate for a subdomain of a domain already on the host.
- Issue an SSL certificate for the subdomain.
- Run the installer against that subdomain, or install manually into its document root.
- Discourage search engines under Settings → Reading, and protect the subdomain with a password at the server level.
That last step matters. An indexed staging copy competes with the real site, and a staging site left open is a common source of leaked content and stale forms.
After any install
- Choose a permalink structure and do not change it later without redirects.
- Delete unused themes and plugins; each one is code you have to keep updated.
- Set up backups immediately, per how to back up a WordPress site.
- Work through the essentials in the WordPress SEO checklist and the security checklist.
- Install only the plugins you need — the process is in how to install a WordPress plugin.
Common install problems
| Symptom | Cause |
|---|---|
| "Error establishing a database connection" | Wrong credentials, or the user was not added to the database — see the full guide |
Site lands at /wordpress/ |
Archive extracted with its wrapper folder |
| Directory listing instead of the site | index.php missing, or the document root is wrong |
| Installer loops back to setup | wp-config.php was not written |
| Homepage works, other pages 404 | Permalinks not flushed — see permalinks not working |
| Browser warns the site is not secure | Certificate not issued yet — see the not secure warning |
Installing onto an existing domain with a live site
Do not install over a working site. Either install to a subdomain and migrate when ready, or take a full backup first and follow how to migrate a WordPress site in reverse. A fresh install into a populated directory produces a half-working mixture of both sites that is unpleasant to unpick.
Frequently asked
- The installer is fine for most sites and much faster. Install manually when you want a specific WordPress version, a non-standard directory, or a database configuration the installer will not create.
- Yes. Keep the files in the subdirectory and set the home URL to the root domain while the site URL points at the subdirectory. It is a supported layout but adds a step to every migration.
- So several WordPress installs can share one database. Changing it from wp_ offers marginal security value on a new install and is not worth doing on an existing one.