There are two ways to install WordPress. First is to download zip file, upload on your web host and unzip files. It’s messy and unproductive.
The second method and most productive way to install WordPress is via command line. Most of people again use few commands to install WordPress.
Here is what genius techies like us do, run one line of command and install WordPress.
Login to your web host and go to the root folder of domain where you want to install WordPress.
Copy and paste following command line and viola, your WordPress is installed.
wget http://wordpress.org/latest.tar.gz; tar xfz latest.tar.gz; mv wordpress/* ./; rm -rf ./wordpress/; rm -f latest.tar.gz
Add Alias to the above command
If you have a web host such as a dedicated host and wish to install many WordPress sites then you can add above command line as alias in your bash profile.
vi ~/.bashrc
Copy and paste following line
alias installwp='wget http://wordpress.org/latest.tar.gz; tar xfz latest.tar.gz; mv wordpress/* ./; rm -rf ./wordpress/; rm -f latest.tar.gz'
Save file and run following command
source ./.bashrc
Next time you want to install a WordPress on a domain then go to the home directory (www) of that domain and run following command
installwp
Awesome! I just copy & pasted that command and bingo! it installed WordPress in no time. You should also add instructions to add shortcut to this command.
Thanks for suggestion Tommy, I’ve updated post to include instructions to create alias for that command.
What to do after using this command? I mean how to install rest of bit afterwards.
Well, in any ways you install a WordPress site you will have to specify database details. This part has to be done manually and there is no way for WordPress script to know database details unless you specify it. It can’t be automated. So access your website by typing your url in a browser and just follow instructions.
Awesome bro, works like a charm.
Simply brilliant, didn’t know that installing WordPress can be so easy. You should create a script which can take care of creating database too.
Will try to write script if I get time and motivation 🙂 meanwhile stick to manual process it’s not a lot of work unless you create many WordPress sites in a day.
Found this post by searching for Install WordPress with one line of code. It’s so amazing that it can be done so quickly. I wish I had known this command earlier.