Installing WordPress using the WP-CLI (WordPress Command Line Interface) is a quick and efficient way to set up a new WordPress site. Here are the steps to install WordPress with the WP-CLI command:
Step 1: Log in to your server via SSH or open a terminal on your computer.
Step 2: Navigate to the directory where you want to install WordPress.
Step 3: Run the following command to download the latest version of WordPress:
wp core download
Step 4: Run the following command to create a wp-config.php file:
wp core config --dbname=your_db_name --dbuser=your_db_user --dbpass=your_db_password --dbhost=your_db_host
Make sure to replace your_db_name
, your_db_user
, your_db_password
, and your_db_host
with your actual database name, username, password, and host.
Step 5: Run the following command to create the WordPress database:
wp db create
Step 6: Run the following command to install WordPress:
wp core install --url=your_site_url --title=your_site_title --admin_user=your_username --admin_password=your_password --admin_email=your_email
Make sure to replace your_site_url
, your_site_title
, your_username
, your_password
, and your_email
with your actual site URL, site title, admin username, password, and email.
Once the installation is complete, you can log in to your WordPress site using the admin credentials you set up in Step 6.
That’s it! You have successfully installed WordPress using the WP-CLI command.