Download and Install WordPress via Command Line SSH

SSH is a lot faster downloading WordPress and uploading it to your server than via FTP. These are the SSH commands to get the latest WordPress package and install it on your server.

To run these commands, you must have an SSH client installed. In Mac OSX and Linux SSH client is build it with Terminal but on Windows, you can use PuTTY, which you can download for free. You must also make sure that your host grants you SSH access to your server.

Make an SSH connection to your server via your SSH client (via PuTTY on Windows). In a Linux/Ubuntu terminal, you can simply do:

ssh YOUR_FTP_USERNAME@domain.com

replacing “YOUR_FTP_USERNAME” and “domain.com” with your own details. You will be prompted for your password.

When you are connected successfully, you won’t receive an error or a confirmation, just a prompt where you can start typing. You should now be in the root of your website!
You can check that you are in the root of your website by typing:

ls

This will list the contents of the folder you are in. You should see your WordPress files in those folders (wp-admin, wp-content, wp-includes, etc). If you see a bunch of folders like publichtml or httpdocs or www, type:

cd folder

This changes your directory to that folder and then you can use the ls command again to see what’s inside. Go to the directory for the website in which you want to install WordPress.

cd html/sitedir/

Get the latest WordPress package and extract it.

wget https://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz

If you get an SSL error here, please see this.

Move the files out of the wordpress folder and into your site’s root.

mv wordpress/* ./

Delete the .tar.gz file and empty wordpress directory, which we no longer need.

rmdir ./wordpress/
rm -f latest.tar.gz

Go to your site in your browser. You will be redirected to http://yoursite.com/wp-admin/install.php.
For this, you should have already created a new database on your server for WordPress to use. You’ll need to gather this information about the database:

  • Database Name
  • Database Username
  • Database Password
  • Database Host

Fill in the requested information and install click “Install WordPress“.
We are Done. Thanks for Reading…

Similar Posts

Leave a Reply

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