How to install WordPress via ssh

Quick look at the commands.  Skip below to view the explanation of the commands

ssh steve@incredigeek.com
cd ~/
wget https://wordpress.org/latest.tar.gz
tar zxvf latest.tar.gz
vi wordpress/wp-config.php   <-- Edit MySQL settings
mv -R wordpress/ /var/www/html/
exit
steve@localhost ~: chrome incredigeek.com/

 

SSH into your webserver

ssh bob@yourserver.com

Download the latest version of WordPress

cd ~/ && wget https://wordpress.org/latest.tar.gz

Extract the WordPress archive

tar zxvf latest.tar.gz

Create MySQL database and user

Refer to here if you want to do it from the command line.  The recommended way is through your web control panel i.e. cPanel, Plesk, EHCP etc.

Edit wp-config.php

Enter in the DB information.

vi wordpress/wp-config.php

Move WordPress files to web directory

mv -R wordpress/* /path/to/webdir

If you want to install WordPress inside a sub directory on your website i.e. instead of going to “example.com” to access your WordPress site, you go to “example.com/wordpress”, then create a sub directory in your root web directory and move the WordPress files there.

Open up a browser and go to your website (example.com) to finish the WordPress installation.

 

Leave a Reply

Your email address will not be published. Required fields are marked *