Install WordPress in 7 Seconds

Posted on

Doing the same repetitive thing over and over again can get boring. I install a lot of WordPress sites, so I thought there must be a quicker way. Well, lucky for us there is. I think its faster than a one click install, such as using some cPanel WordPress install tool. In fact, it literally takes just 7 seconds to install WordPress. What we will be using is a bash script to do our heavy lifting. Just to let you know, this is an improvement on my other post outlining this same thing.

What do I need?

First of all, you really don’t need much. All you need to be able to log in using ssh and the script.

The Bash Script

Log into your server and create a bash script wherever you keep your scripts at. I recommend placing the script outside of the root.

The script: wordpress.sh

#!/ramdisk/bin/bash

wget http://wordpress.org/latest.zip
unzip latest.zip && rm latest.zip
cp -r wordpress/* ./ && rm -rf wordpress/
echo "Finished!"
  • Line 1: Location of your bash. Find yours by doing which bash
  • Line 3: Download the WordPress zip archive.
  • Line 4: Unzip and then delete the archive.
  • Line 5: Copy all the files from the wordpress/ folder into your current directory
  • Line 6: Lets you know when it completes.

Using it.

Just create a directory where you would like to install WordPress, enter the directory. Then just type the location to your bash script and you are 7 seconds away from a painless WP install.

Conclusion

In a nutshell, your are not one of the fastest people to have ever installed WordPress. Let me know if you find this useful! And happy coding!