Install WordPress Using WP-CLI Updated on March 11, 2024 by InMotion Hosting Contributor 3 Minutes, 5 Seconds to Read WP-CLI, WordPress Command Line Interface, is a powerful set of tools, available with WordPress Hosting at InMotion. WP-CLI commands allow you to perform common WordPress management tasks via the command line. One great example is the ability to completely install WordPress from the command line, which saves time compared to the manual option. In this guide, you will learn how to use WP-CLI to setup a new WordPress website from the command line. NOTE: Due to the way cPanel manages databases, if you create a WordPress database using WP-CLI, your database will not be accessible. Therefore, you will need to create a MySQL Database in cPanel. Then, create a MySQL database user and assign that user all privileges to access it. Install WordPress SSH into your server as the cPanel user that owns the website you are installing WordPress on. Use the cd command to switch to the document root directory of your website. Example: cd public_html/my_website NOTE: Be sure to replace public_html/my_website with the actual path to the document root directory of your website. Run the following command to download WordPress (into the document root directory you are in): wp core download Run the following command to configure WordPress: wp core config –prompt Refer to the table below for a description of the values you will enter when prompted. Prompt Description Value 1/11 dbname: * Enter the name of the MySQL database created exampl3_wp 2/11 dbuser: * Enter the name of the MySQL database user created exampl3_wp 3/11 dbpass: * Enter the password created for the database user DBp@s$w0rd123! 4/11 dbhost: Enter the hostname of the MySQL database server 5/11 dbprefix: Enter the prefix to use in the MySQL database structure 6/11 dbcharset: Enter the database character set 7/11 dbcollate: Enter the database collation 8/11 locale: Enter the WPLANG constant 9/11 extra-php (Y/n): * Enter Y to add any PHP code from STDIN or n to skip n 10/11 skip-salts (Y/n): * Enter Y to generate or n to skip generating keys and salts n 11/11 skip-check (Y/n): * Enter Y test or n to skip testing the database connection n Simply type in your custom value and then press the Enter key to proceed through each prompt. NOTE: The values in the table are the values used for our example, when writing this guide. Some values are left blank intentionally. In this case, the default configuration will be used. Be sure to use your own custom values. To use a default value, simply press the Enter key (without entering data) to proceed through the prompts. Prompts in the table marked with an asterisk (*) require a custom value (you can not leave these fields blank). Run the following command to install WordPress: wp core install –prompt Refer to the table below for a description of the values you will enter when prompted. Prompt Description Value 1/6 url: Enter the URL for your website example.com 2/6 title: Enter the site title for your website WPCLI Example Site 3/6 admin_user: Enter the administrator username exampl3_wpadmin 4/6 admin_password: Enter the administrator password @DM|Np@s$w0rd123! 5/6 admin_email: Enter the email address for the administrator [email protected] 6/6 skip-email (Y/n): Enter Y to email or n to skip emailing the admin details Y Simply type in your chosen value and then press the Enter key to proceed through each prompt. NOTE: The values in the table are the values used for our example, when writing this guide. Be sure to use your own custom values. All prompts require custom values (you can not leave any fields blank). Congratulations! You now know how to install WordPress from the command line, using WP-CLI. Learn more about WP-CLI, the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows! Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Install and Configure WP-CLI How to Create and Delete a WordPress Page Using WP-CLI Install a Theme Using WP-CLI Install WordPress Using WP-CLI Manage WordPress Comments Using WP-CLI Update WordPress Using WP-CLI Manage WordPress Users Using WP-CLI WP-CLI search-replace Command Delete WordPress Transients Using WP-CLI Manage WordPress Plugins with WP-CLI