Installing WordPress via Terminal or SSH

0

Connect via SSH

SSH connect to the domain. If you are on a localhost then just navigate to the location where you want wordpress to reside and skip to the next step.

SSH Command

Change “username” to your user name and “domain.com” to your domain name or IP address. The default SSH port is 22. If its different in you r case then change it to the appropriate value.

Download WordPress

After logging in navigate to the location where you want wordpress to reside. For example you want to install at http://domain.com/wordpress. By default the apache document root is “/var/www/html”.So we are going to install wordpress on “/var/www/html/wordpress”.

Now lets download the latest version of WordPress

Once in the right directory use the wget command to download the latest version of wordpress.

Exacting WordPress

Once the download process is finished we need to extract the compressed tar file. If you are not sure what is the file name you can use the ls command to list all the files in that directory.

Here you can view all the files and folders that exists in this directory. Then just run the following commands to extract the compressed file.

Please replace the file name with the appropriate file name.

Moving the Files

The extract files are extracted inside another sub folder so you are going to move all the files to the current directory.

Removing unnecessary files

Now remove the sub folder and the downloaded file.

Creating MySQL Database

First login to the MySQL command line

After logging in just run the following commands to create a database and grant access to the database.

Running the above command will create a MySQL database named wordpress. And grant a username named “username@localhost” access to that databse.
Next step is to fire up your favorite web browser and navigate to the exact address and the installation process will start.
If you face any problem regarding the “wp-config.php”. Just run”

The above command will create the file and you can paste the installation information there.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.