Installing WordPress via SSH command line

Sometimes it is easier to install WordPress on your server without downloading it locally and then uploading it to your website.

1. Log in to the server via SSH.

ssh username@mondomain.ca -p 22

2. Change to mondomain.ca/public_html directory and download the file there.

cd /home/mondomain.ca/public_html

3. The newest version of WordPress is always available at http://wordpress.org/latest.tar.gz

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

4. Extract it.

tar -zxvf latest.tar.gz

5. Move all files and folders (*) to the folder above the one you are in.

mv wordpress/* ../

6. Remove wordpress folder and the downloaded file.

rm -r wordpress
rm latest.tar.gz

7. Rename wp-config-sample.php to wp-config.php.

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

8. Then we need to edit wp-config.php.

nano wp-config.php

9. Add DataBase databasename/username/password/host.

/** 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’);

10. Create uploads folder and change chmod.

cd wp-content/
mkdir uploads
chmod 755 uploads/

11. Open mondomain.ca in browser, complete the installation, choose a username and password!

lynx http://mondomain.ca

12. Congrats!