How to install WordPress via ssh

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

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


SSH into your webserver


Download the latest version of WordPress

cd ~/ && wget

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 “” to access your WordPress site, you go to “”, 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 ( to finish the WordPress installation.


Leave a Reply