1. Home
  2. How To
  3. How to manually install WordPress on Linux

How to manually install WordPress on Linux

Here are the steps needed to install WordPress manually on Linux.

Download WordPress

Go to the document root of your domain and download the most current version of the WordPress package.

For example

cd /home/eurovps/public_html/

Via SSH, you can wget the latest WordPress file to your website.

 wget https://wordpress.org/latest.zip 

Extract the WordPress Archive

Unzip the downloaded file using the following command via SSH.

unzip latest.zip

Move All files/folders from the WordPress folder to correct document root.

For Example :

mv wordpress/* /home/eurovps/public_html/

Remove WordPress folder and latest.zip file.

rm -rf wordpress latest.zip

Correct the permission of WordPress files/folders.

Change user and group permission to correct user of your domain. In our case, the website user name is eurovps.

chown eurovps.eurovps /home/eurovps/public_html/* -R

Create a MySQL Database and user for WordPress.

You need to create a MySQL database and assign a MySQL user to it with full permissions.

Here are the commands to create database, user and grant privileges

  • create database db_name; 
  • create user db_user; 
  • grant all on db_name.* to ‘db_user’@’localhost’ identified by ‘db_password’;
MariaDB [(none)]> create database eurovps_wp;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> create user eurovps_usr;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON eurovps_wp.* TO "eurovps_user"@"localhost" IDENTIFIED BY "password";
Query OK, 0 rows affected (0.001 sec)

Update database details in the WordPress configuration file.

Rename the file wp-config-sample.php to wp-config.php and update database details in the file.

mv wp-config-sample.php wp-config.php
	
vi wp-config.php

/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );

/** MySQL database username */
define( 'DB_USER', 'username_here' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Update these entries with our database details.

Access your website using any browser.

Enter these details as you wish and click Install WordPress

Updated on July 5, 2021

Was this article helpful?

Related Articles