Installing WordPress at the command line

Watch out! This tutorial is over 6 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

After you have installed LAMP on your Linux server (or fired up a template with LAMP already installed), you may want to use a CMS like WordPress. But how to install? What are the commands?

You would need to do something like the following. First, make sure you have root privileges (sudo -i). Then, the steps are:

  • Change to web directory
  • Pull down latest WordPress version
  • Extract the files
  • Set correct permissions on the new directory

The commands for this would be:

cd /var/www/html
wget https://wordpress.com/latest.tar.gz
tar -xvzf latest.tar.gz
chown -R www-data:www-data wordpress/

Now simply visit http://ip-address-of-your-vm/wordpress to carry out the install. You will need to have created your database and have the user credentials on hand. The database may have been created locally or on another server, that bit is up to you. You could even use your student database on http://mysql02.comp.dkit.ie, if you have an account there.  See also this tutorial.

Afterwards you may wish to look at this tutorial.

Tip: It would not be out of the question to login via SSH to a MySQL Server created using the template MySQL Server (with PHPMyAdmin) and carry out the above commands.  This way everything would be on one server. Remember to create your database user (and a database for them) before setting up WordPress.