1. Home
  2. Knowledge Base
  3. Applications
  4. Wordpress
  5. How to manually install WordPress via SSH command line

How to manually install WordPress via SSH command line

Downloading WordPress from the internet:
———————————————–
Step 1: Login to server and choose the particular user directory
Step 2: Navigate to public_html folder
Step 3: Run the below commands to download wordpress zip file from the internet and extract the wordpress files on the wordpress installation directory.

+++
Command: wget http://wordpress.org/latest.tar.gz

tar xfz latest.tar.gz

mv wordpress/* ./
+++

Installing WordPress:
———————
Step 1: Login to mysql console. If you logged in as root then, just enter ‘mysql’ on the command line. In order to login as particular user, run the below command line.

+++
mysql -u username -p
+++

Step 2: Now we have to create the database for the user directory. We can do it either by the cPanel database option or command line.

+++
create database yourwordpress_dbname;
grant usage on *.* to username@localhost identified by ‘password’;
grant all privileges on yourwordpress_dbname.* to username@localhost;
+++

The first command create the database, Second command allows the user to connect the database. Third command grant all privileges to the user.

Step 3: Alternatively, you can follow the below steps to create the database via cPanel interface and set to the wordpress installtion.

+++
From cPanel: Login to your cPanel > Database section > mysql databases > Create database and user > Assign user to the joomla database
+++

Step 4: Now, we need to configure the database via configuration file of WordPress installation, go to the wordpress installation directory and excute the below command.

+++
vi wp-config.php
+++

You can use your favourate text editor, here we are using ‘vi’. Once the ‘wp-config.php’ opened, type ‘i’ to edit the file and modify the database name, username and password details as shown in the below snippet.

+++
* MySQL settings
define( ‘DB_NAME’, ‘database_name_here’ );
define( ‘DB_USER’, ‘username_here’ );
define( ‘DB_PASSWORD’, ‘password_here’ )
+++

Step 5: Now visit your website via browser and ensure the wordpress installation completed successfully.

Related Articles