(dv) 3.5:Install WordPress via SSH

  • This page was last modified on May 10, 2012, at 10:34.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

End of Life Warning

This service has a pending End of Life. Please move to a current service as soon as possible. For more information, please see: (dv) Dedicated-Virtual 4.0: Migration Information.


While there is a 1-Click install for the (gs) Grid-Service, there is not one for the (dv) Dedicated-Virtual. However, you can do it manually by typing in the following set of commands, once you have logged into SSH as the root user:

cd /var/www/vhosts/example.com/httpdocs
rm -rf *
wget http://wordpress.org/latest.zip
unzip latest.zip
cp -rpf ./wordpress/* .
rm -rf ./wordpress/latest.zip
chown -R domainuser:psacln /var/www/vhosts/example.com/httpdocs/*

Note that for the last command, you'll want to change 'domainuser' with the ftp username assigned for this domain or subdomain.

Basically, the above commands will take you to the /httpdocs folder of your domain, delete all the files and folders inside that folder, download the latest version of WordPress, then unzip it (if the downloaded version is different than what is shown above, then change the command accordingly). From there, you're copying all the files from the newly created /wordpress folder to the /httpdocs folder, so that when you bring the domain up, it'll bring up the WordPress blog. And lastly, you're deleting the contents of the /wordpress folder, the folder itself and the WordPress .zip file.

Now, create the database your WordPress installation will use. You'll want to change 'example_db' (yourdomain_wp for instance), 'example.com' (with your domain name), 'example_user' (make something up here, its OK if it's the same as database name), and 'example_password' (something strong, you probably won't need it after you finish the installation):

/usr/local/psa/bin/database.sh -c example_db -domain example.com -type mysql
/usr/local/psa/bin/database.sh -u example_db -add_user example_user -passwd example_password

And that's it! If you go to your domain, you should be able to create your admin user and proceed from there.

Now, if you want to install a theme to your WordPress blog, the following set of commands can help with that. The myexcitingtheme.zip is just an example. Your theme's filename should go there instead.

cd ./wp-content/themes
wget http://wordpress.org/extend/themes/download/myexcitingtheme.zip
unzip myexcitingtheme.zip
rm -f myexcitingtheme.zip

So, these commands had you browse to the /themes folder, download the theme file, unzip it, then delete it. It should be noted that you can do the same thing with plug-ins. If you switch out the word "themes" with "plugins" in the first line above, you'll be in the /plugins folder, where you can follow the same set of commands (with a different URL to download plug-ins) and install plug-ins for your WordPress blog. You should now able able to access the new theme (or plug-in) in the WordPress administration page.