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
- Point your domain's DNS at the hosting account or server.
- Create an empty database and a database user with all privileges on it.
- Put the WordPress files in the web root (or let Softaculous or WP-CLI do it).
- Fill in
wp-config.phpwith the database name, user, password and host. - Run the installer and create an admin user with a strong password.
- 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
- 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. - Download the latest zip from wordpress.org, upload it in File Manager to
public_htmland extract it. Move the contents of thewordpressfolder up intopublic_htmland delete the empty folder and the zip. - Open your domain in a browser. WordPress finds no
wp-config.phpand offers to create one; enter the database name, username and password, keep the host aslocalhost, and keep the table prefix or changewp_to something unique. - 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 --forceandwp comment delete 1 --forcedo 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 );inwp-config.phpto 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:
- 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.
- Create the core pages. Pages, Add New Page: Home, About, Services or Products, and Contact, plus a privacy policy.
- Set the home page. Settings, Reading, choose "A static page" and select Home.
- Build the menu in the Site Editor (Navigation) or under Appearance, Menus on classic themes.
- 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.
- 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 )
- WordPress Developer Resources: How to install WordPress
- WordPress.org: Requirements
- WP-CLI Handbook: Installing WP-CLI
- WordPress Developer Resources: wp core install
- Softaculous: Install a script
- WordPress Developer Resources: Hardening WordPress