Initialize a WordPress Vagrant box based on homestead.
Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment for Laravel framework.
As homestead already contains everything that we need, here we are extending homestead for our WordPress project.
WordPress Vagrant Includes
- Ubuntu 18.04
- PHP 7.2
- PHP 7.1
- PHP 7.0
- PHP 5.6
- Apache (Optional)
- MariaDB (Optional)
- Node (With Yarn, Bower, Grunt, and Gulp)
- Elasticsearch (Optional)
- Zend Z-Ray
- Running WordPress Instance
Clone WordPress Vagrant:
git clone https://github.com/khaledsaikat/wordpress-vagrant.git
Then go to your cloned directory and install composer dependencies by running following command:
Setting Your SSH Key
You will need to have ssh keys for accessing virtual server. On Mac and Linux, you can create an SSH key pair using the following command:
ssh-keygen -t rsa -C "you@wordpress"
Run vagrant box
To run vagrant box type:
This shall create a new instance of Ubuntu 14.04 with included softwares.
To ssh new instance, run following command:
Access your WordPress blog
You can see your WordPress blog by visiting http://192.168.10.10/
To use custom domain, add following line to your hosts file:
On Mac and Linux, this file is located at /etc/hosts. On Windows, it is located at C:\Windows\System32\drivers\etc\hosts.
Now visit http://wordpress.app to check your new blog.
You can find all WordPress files inside
wordpress directory on your local machine. Now use your favorite editor to modify files. Any modification will immediately reflect on virtual machine.
Admin access of WordPress:
- username: admin
- password: secret
- dbname: wordpress
- dbuser: homestead
- dbpass: secret
Homestead.yaml comes with several configurations. You can map any local directory to virtual server and also configure custom domain.
To get more info about homestead, visit Laravel Homestead