WP-CLI lets you install WordPress from an SSH session. This guide uses it on an AlmaLinux server with an existing web hosting configuration, so you can download WordPress, connect its database and create the administrator account.

Before you begin

You need:

  • A supported AlmaLinux release and SSH access as the website’s account user.
  • A configured domain, working HTTPS and an empty document root owned by that user.
  • A PHP version and extensions supported by WordPress.
  • An empty MySQL or MariaDB database and a user authorised to access it.
  • WP-CLI installed and available through wp.

If a control panel manages the server, create the database and user through that panel. Do not replace its PHP packages with unrelated system packages.

Check WP-CLI

Run:

wp --info

If WP-CLI is missing, follow its official installation instructions and verify the downloaded release before using it. Run WordPress commands as the site user, rather than adding --allow-root to bypass the root-user check.

Download and configure WordPress

  1. Change to the domain’s actual document root. Confirm that it is empty and belongs to the intended site.

  2. Download the British English release:

    wp core download --locale=en_GB
  3. Create the configuration, replacing the database and user names with their full names:

    wp config create --dbname=SITE_DATABASE --dbuser=SITE_DATABASE_USER --dbhost=localhost --prompt=dbpass
  4. Enter the database password when prompted. Use the database host supplied by your provider if it is not localhost.

Complete installation

Replace the example URL, title, username and email address with your site’s details:

wp core install --url='https://example.com' --title='My website' --admin_user='siteadmin' --admin_email='[email protected]' --prompt=admin_password
wp core is-installed
wp core verify-checksums

Enter a strong administrator password when prompted. Do not put real passwords directly into command lines that may be saved in shell history.

Open the website and /wp-admin/ in a browser. Check HTTPS, administrator access and file permissions, then configure backups and updates. File ownership must match your hosting configuration; do not recursively assign every site file to Apache as a general fix.