WP-CLI is a command-line interface for managing WordPress installations, and it can be used to install WordPress via SSH. Here’s how:
- Connect to your server via SSH: You’ll need to use a terminal or command-line interface to connect to your server via SSH. This will require you to have access to your server login credentials.
- Install WP-CLI: Once you’re connected to your server via SSH, you’ll need to install WP-CLI. You can do this by following the instructions provided on the WP-CLI website.
- Create a database: Before you can install WordPress, you’ll need to create a new database. You can do this using the command-line interface by typing:
mysql -u username -p
Replace “username” with your MySQL username. You’ll be prompted to enter your MySQL password. Once you’re logged in, type:
CREATE DATABASE database_name;
Replace “database_name” with the name of your new database.
- Download WordPress: Next, you’ll need to download the latest version of WordPress. You can do this using the command-line interface by typing:
wp core download
This will download the latest version of WordPress to your server.
- Create a wp-config.php file: WordPress requires a configuration file to connect to your database. You can create this file using the command-line interface by typing:
wp config create --dbname=database_name --dbuser=username --dbpass=password
Replace “database_name”, “username”, and “password” with your database name, username, and password.
- Install WordPress: Finally, you can install WordPress using the command-line interface by typing:
wp core install --url=example.com --title="My WordPress Site" --admin_user=admin --admin_password=password --email@example.com
Replace “example.com”, “My WordPress Site”, “admin”, “password”, and “firstname.lastname@example.org” with your website URL, site title, admin username, admin password, and admin email address.
That’s it! You’ve now installed WordPress via SSH using WP-CLI.