Talk to the NOC, IST hours — +91 75994 50220 support@bigdomainhost.com
Guide

Installing WordPress on cPanel hosting or an Ubuntu VPS, step by step

There are two common ways to get WordPress running: a cPanel hosting account or your own Ubuntu server. This guide covers both with exact steps and commands, then shows how to turn the fresh install into a working website.

Short answer: How to install WordPress depends on your hosting. On cPanel, use Softaculous if available, or create a MySQL database and user, upload WordPress to public_html and run the installer. On an Ubuntu 24.04 VPS, install Nginx or Apache, PHP-FPM and MariaDB, add HTTPS with Certbot, then run wp core download, wp config create and wp core install.

How to install WordPress: the two routes

How to install WordPress depends on where your site will live. On cPanel hosting you either use the Softaculous one-click installer, if your host provides it, or do a manual install: create a MySQL database and user, upload the files and run the web installer. On a VPS you build the stack yourself (web server, PHP-FPM and MariaDB or MySQL) and then install WordPress with the browser installer or WP-CLI. Both routes end at the same dashboard, and both take well under an hour.

WordPress currently recommends PHP 8.3 or newer and MariaDB 10.11 or newer (or MySQL 8.4 or newer), plus HTTPS. Ubuntu 24.04 ships PHP 8.3 and MariaDB 10.11, so its stock packages meet that.

Quick checklist

  1. Point your domain's DNS at the hosting account or server.
  2. Create an empty database and a database user with all privileges on it.
  3. Put the WordPress files in the web root (or let Softaculous or WP-CLI do it).
  4. Fill in wp-config.php with the database name, user, password and host.
  5. Run the installer and create an admin user with a strong password.
  6. Switch on HTTPS, then set permalinks, timezone and basic security.

How to install WordPress on cPanel

One-click: Softaculous

If your cPanel has a Softaculous icon, open it, choose WordPress and click Install. Set the protocol to https:// (once the domain's SSL certificate is active), pick the domain, and leave In Directory empty so the site loads at the root rather than at /wp. Enter the site name, an admin username that is not admin, a strong password and your email, then click Install. Softaculous creates the database, user and wp-config.php for you and shows links to the site and its admin area when it finishes.

Manual install in cPanel

  1. In MySQL Databases (or the MySQL Database Wizard), create a database, then a user, and add the user to the database with All Privileges. cPanel prefixes both names with your account name, for example acct_wp. Note the full names.
  2. Download the latest zip from wordpress.org, upload it in File Manager to public_html and extract it. Move the contents of the wordpress folder up into public_html and delete the empty folder and the zip.
  3. Open your domain in a browser. WordPress finds no wp-config.php and offers to create one; enter the database name, username and password, keep the host as localhost, and keep the table prefix or change wp_ to something unique.
  4. Click Run the installation, fill in the site title, admin username, password and email, and submit.

If you see "Error establishing a database connection" at this point, one of the four values is wrong; this database connection guide walks through each check.

How to install WordPress on Ubuntu 24.04 (Nginx, PHP-FPM, MariaDB)

Start from a secured server with a sudo user and a firewall that allows ports 80 and 443, as set out in Ubuntu VPS initial setup. Then install the stack:

sudo apt update
sudo apt install nginx mariadb-server php8.3-fpm php8.3-mysql php8.3-curl \
  php8.3-gd php8.3-intl php8.3-mbstring php8.3-xml php8.3-zip php-imagick
sudo mariadb-secure-installation

Create the database and user

sudo mariadb
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'use-a-long-random-password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
EXIT;

Nginx server block

Create /etc/nginx/sites-available/example.com:

server {
    listen 80;
    server_name example.com www.example.com;
    root /var/www/example.com;
    index index.php index.html;
    client_max_body_size 64M;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
}
sudo mkdir -p /var/www/example.com
sudo chown -R www-data:www-data /var/www/example.com
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

client_max_body_size only lifts Nginx's limit; PHP's own default upload limit is 2 MB, so also raise upload_max_filesize and post_max_size in /etc/php/8.3/fpm/php.ini and run sudo systemctl restart php8.3-fpm.

Prefer Apache? Install apache2 instead of nginx, then run sudo a2enmod proxy_fcgi setenvif rewrite and sudo a2enconf php8.3-fpm. Create a virtual host in /etc/apache2/sites-available/ with DocumentRoot /var/www/example.com, enable it with sudo a2ensite, and set AllowOverride All for the site directory so WordPress can write its permalink rules to .htaccess.

HTTPS with Certbot

Once the domain resolves to the server, get a free Let's Encrypt certificate. Certbot's own instructions use the snap package (remove any apt-installed certbot first with sudo apt remove certbot):

sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot
sudo certbot --nginx -d example.com -d www.example.com
sudo certbot renew --dry-run

Use --apache instead of --nginx on Apache. Doing this before the install means WordPress records an https:// address from the start.

How to install WordPress with WP-CLI

For a WP-CLI install, WordPress needs just three commands in place of the browser installer. Install it first:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

Run the WordPress commands as www-data so the files get the right owner. --prompt asks for passwords interactively, which keeps them out of your shell history:

cd /var/www/example.com
sudo -u www-data wp core download
sudo -u www-data wp config create --dbname=wordpress --dbuser=wpuser --prompt=dbpass
sudo -u www-data wp core install --url=https://example.com --title="My Site" \
  --admin_user=siteowner --admin_email=you@example.com --prompt=admin_password

wp config create also fills in fresh security keys and salts. If you prefer the browser, skip the last two commands and open your domain instead.

File permissions

The WordPress hardening guide uses 755 for directories and 644 for files, with wp-config.php tighter at 440 or 400:

sudo find /var/www/example.com -type d -exec chmod 755 {} \;
sudo find /var/www/example.com -type f -exec chmod 644 {} \;
sudo chmod 440 /var/www/example.com/wp-config.php

First settings after you install WordPress

On a VPS, run the wp commands below from the web root as sudo -u www-data wp ...; WP-CLI refuses to run as root unless you add --allow-root, which is best avoided.

  • Permalinks: Settings, Permalinks, choose Post name, or run wp rewrite structure '/%postname%/'.
  • Timezone: Settings, General, choose Kolkata, or run wp option update timezone_string Asia/Kolkata.
  • Default content: delete the "Hello world!" post, "Sample Page" and the sample comment. On a fresh install, wp post delete 1 2 --force and wp comment delete 1 --force do it.
  • Security basics: a unique admin username and strong password, two-factor login, only the plugins you use, automatic updates on, and define( 'DISALLOW_FILE_EDIT', true ); in wp-config.php to turn off the dashboard code editor.
  • Backups: confirm they run before you add content.

How to create a WordPress website after installing

Installing gives you an empty site. Here is how to make a WordPress website that people can use:

  1. Pick a theme. Appearance, Themes, Add New Theme. A lightweight block theme is the simplest start; the Site Editor then lets you change the header, footer and colours without code.
  2. Create the core pages. Pages, Add New Page: Home, About, Services or Products, and Contact, plus a privacy policy.
  3. Set the home page. Settings, Reading, choose "A static page" and select Home.
  4. Build the menu in the Site Editor (Navigation) or under Appearance, Menus on classic themes.
  5. Add only essential plugins: a contact form, an SEO plugin and a cache plugin suited to your server. If one misbehaves, see WordPress plugin not working.
  6. Untick Discourage search engines under Settings, Reading when you are ready to launch.

Installing WordPress on Bigdomainhost

On Bigdomainhost WordPress hosting you can skip the install: WordPress comes pre-installed and hardened, with LiteSpeed Cache already configured, on LiteSpeed servers in Mumbai (BOM-1). You get full cPanel, daily backups, and one-click staging on the Advanced plan and above. On Web & cPanel hosting you can use the Softaculous one-click installer or the manual cPanel route above, with PHP 5.6 to 8.4 selectable per domain and a free SSL certificate for every domain. Moving an existing site is free on both.

For the VPS route, a Bigdomainhost KVM VPS offers Ubuntu 24.04, lets you add your SSH key at order time, and includes an out-of-band console in the control panel if a firewall change locks you out. Servers are in Mumbai (BOM-1) and Delhi NCR (DEL-1). For help, call +91 75994 50220 during IST hours, WhatsApp the same number at any time, or email support@bigdomainhost.com.

Sources (checked )

Answers

Frequently asked questions

Still unsure? Call +91 75994 50220 or write to support@bigdomainhost.com — a human replies in IST hours.

How do I install WordPress on cPanel?

Open Softaculous in cPanel if your host provides it, choose WordPress, set the domain and admin details and click Install. Without it, create a MySQL database and user in cPanel, upload and extract WordPress into public_html, then open your domain and enter the database details when the installer asks.

How do I install WordPress on Ubuntu?

On Ubuntu 24.04, install Nginx or Apache, PHP 8.3 FPM with the usual extensions, and MariaDB. Create a database and user, add a server block pointing at your web root, get a certificate with Certbot, then download WordPress and run the installer in a browser or with WP-CLI.

How do I install WordPress with WP-CLI?

Install the wp-cli.phar file as /usr/local/bin/wp, then from the web root run wp core download, wp config create with your database name and user, and wp core install with the site URL, title, admin username and admin email. Use the --prompt option so passwords are not saved in shell history.

How do I create a WordPress website after installing it?

Choose a theme under Appearance, Themes, then create the main pages such as Home, About, Services and Contact. Set Home as the static front page under Settings, Reading, build the navigation menu, add a few essential plugins, and untick Discourage search engines when you are ready to launch.

Why does WordPress show a database connection error after install?

The values in wp-config.php do not match the database. Check DB_NAME, DB_USER, DB_PASSWORD and DB_HOST, remembering that cPanel adds your account name as a prefix to database and user names. Also confirm the user was added to the database with all privileges and the database server is running.

Support that picks up the phone.

In IST hours, in Hindi or English, and WhatsApp replies fastest at any time. Sales, migration and emergencies all reach the same engineers. No offshore queue, no 48-hour first reply.

Need cPanel or WHM with the ports already sorted?

Web & cPanel hosting comes with cPanel ready to log in to, reseller hosting adds white-label WHM, and a KVM VPS can have cPanel & WHM pre-installed. Call +91 75994 50220 or email support@bigdomainhost.com.