- Navigate to http://wordpress.org/.
- Click on the download button. You would be taken to the download page, http://wordpress.org/download/.
- Download one of the compressed files, http://wordpress.org/latest.zip or http://wordpress.org/latest.tar.gz.
Setup project directory
$ mkdir -p new-project/public && cd new-project/public
Download
$ wget http://wordpress.org/latest.tar.gz
Unpack
$ tar -xzf latest.tar.gz
Install
$ mv wordpress/* .
Cleanup
$ rm latest.tar.gz && rm -rf wordpress
We can automate the installation in several ways:
- Using an alias
- Writing a shell script
- Using wp-cli
If you want to use an alias, then you can put the following in your .bashrc
file: alias wpinstall="wget http://wordpress.org/latest.tar.gz && tar -xzf latest.tar.gz && mv wordpress/* . && rm latest.tar.gz && rm -rf wordpress"
.
Otherwise,
#!/bin/bash -e
echo "============================================"
echo "A robot is now installing WordPress for you."
echo "============================================"
# Download and unpack
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
# Install
mv wordpress/* .
# Cleanup
rm latest.tar.gz && rm -rf wordpress
echo "========================="
echo "Installation is complete."
echo "========================="
To use wp-cli
check it out here. Once installed, you could do the following:
$ wp core download