Create a Wordpress site from the command line with wp-cli

The first step is to install the wordpress command line tool. The below commands will download the package, grant the appropriate permissions for using the files and move the package to a place in our computer to a place where we can conveniently use it.

1
2
3
4
5
6
7
8
9
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
$ chmod +x wp-cli.phar
$ sudo mv wp-cli.phar /usr/local/bin/wp
$ wp
$ mkdir wordpress-local-site && cd wordpress-local-site
$ wp core download
$ wp server
$ mysql -uroot -p
> create database wordpress;

Full post is on Medium