Knowledgebase

How to Install WordPress (Softaculous on cPanel and Manually on a VPS)

On cPanel shared hosting, the fastest way to install WordPress is Softaculous: open Software → Softaculous Apps Installer → WordPress → Install, choose your domain, set an admin username and strong password, and click Install. On a VPS, you install Nginx, PHP-FPM and MariaDB, create a database, extract WordPress to /var/www/example.com, add an Nginx server block, get a free Let's Encrypt certificate, and finish setup in the browser. This guide covers both methods step by step, plus the settings to change right after installation.

Prerequisites

  • A registered domain whose DNS A record points to your hosting account or VPS IP (for example 203.0.113.10).
  • For Part 1: a cPanel account, such as Cloudesta shared hosting.
  • For Part 2: an Ubuntu 24.04 or 22.04 server with root or sudo SSH access, such as a Cloudesta Cloud VPS, with nothing else using ports 80 and 443.

1. How do I install WordPress with Softaculous in cPanel?

Log in to cPanel and go to Software → Softaculous Apps Installer. Click WordPress, then Install. Fill in the form as follows:

  • Choose Installation URL: select https:// (or https://www.) and your domain. Leave In Directory empty to install at the domain root. If you leave the default wp, the site will load at example.com/wp.
  • Site Settings: enter your site name and tagline. You can change both later.
  • Admin Account: do not use admin as the username. Use a long, unique password and an email address you actually check.
  • Select Plugins: untick anything you don't need. Fewer plugins means fewer updates and a smaller attack surface.
  • Advanced Options: keep the auto-generated database name. Enable automatic minor updates, and turn on automated backups if your plan has space for them.

Click Install. When it finishes, open https://example.com/wp-admin and log in with the admin account you just created.

If the installer warns that the directory is not empty, check public_html in Files → File Manager. A leftover index.html from the default page is normally safe to delete. Never overwrite an existing site you still need.

2. How do I install WordPress manually on an Ubuntu VPS?

Step 1: Install Nginx, PHP-FPM and MariaDB

sudo apt update
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-curl php-gd php-intl php-mbstring php-xml php-zip php-imagick unzip
ls /run/php/

The last command shows the PHP-FPM socket name. It is php8.3-fpm.sock on Ubuntu 24.04 and php8.1-fpm.sock on 22.04. You will need this name in Step 4.

If UFW is enabled, allow web traffic:

sudo ufw allow 'Nginx Full'

Step 2: Create the database and user

sudo mariadb
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace yourpassword with a strong random password and keep a copy of it. The web installer will ask for it later.

Step 3: Download WordPress and set permissions

cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo mkdir -p /var/www/example.com
sudo cp -a /tmp/wordpress/. /var/www/example.com/
sudo chown -R www-data:www-data /var/www/example.com
sudo find /var/www/example.com -type d -exec chmod 755 {} \;
sudo find /var/www/example.com -type f -exec chmod 644 {} \;

Ownership by www-data lets WordPress create wp-config.php, upload media, and install updates without asking for FTP details.

Step 4: Create the Nginx server block

Create /etc/nginx/sites-available/example.com with sudo nano /etc/nginx/sites-available/example.com and paste the following. Adjust the socket name to match your Ubuntu version.

server {
    listen 80;
    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;
    }

    location ~ /\.ht {
        deny all;
    }
}

Step 5: Enable the site

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl reload nginx

Step 6: Add a free Let's Encrypt certificate

sudo apt install -y certbot python3-certbot-nginx && sudo certbot --nginx -d example.com -d www.example.com --redirect

Certbot edits your server block to serve HTTPS and redirect HTTP to HTTPS. It also sets up automatic renewal. Get the certificate before running the installer, so WordPress saves https:// URLs from the start.

Step 7: Run the web installer

Open https://example.com and choose a language. When asked for database details, enter:

  • Database name: wordpress
  • Username: wpuser
  • Password: the password you set in Step 2
  • Database host: localhost
  • Table prefix: wp_

Next, set the site title, admin username, strong password and email. Then log in at /wp-admin.

3. What should I do right after installing WordPress?

  • Permalinks: go to Settings → Permalinks, select Post name, and save.
  • Updates: check Dashboard → Updates. Remove themes and plugins you don't use. On a VPS, also run sudo apt update && sudo apt upgrade regularly to keep PHP and Nginx patched.
  • Backups (cPanel): use JetBackup in cPanel or Softaculous backups.
  • Backups (VPS): schedule backups of both the database and the files, and copy them off the server. For example:
sudo mariadb-dump wordpress | gzip > /root/wp-db-$(date +%F).sql.gz
sudo tar -czf /root/wp-files-$(date +%F).tar.gz -C /var/www example.com
  • Security basics: use unique passwords, enable two-factor authentication through a plugin, and limit login attempts. You can also disable the built-in file editor by adding the line below to wp-config.php, above the "stop editing" comment:
define( 'DISALLOW_FILE_EDIT', true );

Verify it works

  • https://example.com loads the default theme with a valid padlock, and http:// redirects to https://.
  • Open a post. A pretty permalink such as /hello-world/ should load without a 404 error.
  • Upload an image under Media → Add New to confirm write permissions.
  • On a VPS, confirm that all three services are running and that certificate renewal works:
systemctl status nginx mariadb php*-fpm --no-pager
sudo certbot renew --dry-run

Common problems

White screen or "There has been a critical error": this usually means a PHP error, a missing PHP extension, or a broken plugin. To find the cause:

  • On a VPS, check sudo tail -n 50 /var/log/nginx/error.log.
  • Temporarily set define( 'WP_DEBUG', true ); in wp-config.php to display the error.
  • Rename a suspect folder in wp-content/plugins to disable that plugin.

WordPress asks for FTP credentials, or uploads fail: the files are not owned by the web server user. On a VPS, rerun sudo chown -R www-data:www-data /var/www/example.com. On cPanel, files should belong to your cPanel user with 644 (files) and 755 (folders) permissions.

"Error establishing a database connection": the settings in wp-config.php don't match the database. To fix it:

  • Check that DB_NAME, DB_USER, DB_PASSWORD and DB_HOST match what you created.
  • On a VPS, confirm systemctl status mariadb shows the service as active.
  • Test the credentials with mariadb -u wpuser -p wordpress.

Mixed content or broken styling after enabling SSL: WordPress still stores http:// URLs. To fix it:

  • Set both addresses in Settings → General to https://.
  • Replace old links in your content with a search-and-replace plugin, or with WP-CLI if it is installed:
sudo -u www-data wp search-replace 'http://example.com' 'https://example.com' --all-tables --path=/var/www/example.com

413 Request Entity Too Large when uploading: raise client_max_body_size in the Nginx server block. Also raise upload_max_filesize and post_max_size in /etc/php/8.3/fpm/php.ini (or /etc/php/8.1/fpm/php.ini on 22.04). Then reload Nginx and restart the PHP-FPM service.

Frequently asked questions

Should I use Softaculous or a manual install?

Use Softaculous on cPanel hosting. It is quicker and handles the database and backups for you. A manual install on a VPS makes sense when you need full control over the server stack, caching or PHP settings.

Can I install WordPress in a subfolder instead of the domain root?

Yes. In Softaculous, type the folder name in In Directory. On a VPS, extract the files into a subfolder of the web root and access the site at example.com/foldername.

Does Let's Encrypt renew automatically?

Yes. The Ubuntu certbot package installs a systemd timer that renews certificates before they expire. Run sudo certbot renew --dry-run to confirm renewal works.

Need help? If you get stuck, open a support ticket from your client area and include your domain and any error messages.

Was this answer helpful?

0 Users Found This Useful

Powered by WHMCompleteSolution