A flavorful way to manage your entire WordPress stack. Built and maintained by Human Made.
Coming soon: Provisioning production servers with Salty WordPress.
Here's how to get building:
- Clone the repo:
cd ~/; git clone firstname.lastname@example.org:humanmade/Salty-WordPress.git.
- Install the latest version of Vagrant and version 4.2.12 of Virtual Box.
- Salty WordPress can also be used with VMWare 6.x instead of Virtualbox. There is a known issue where you'll need to install
nfs-commonin the VM before your shared directories will work. Keep in mind that, because the shared folders aren't mounted, your first provision will look like this:
vagrant up --provider=vmware_fusion; vagrant ssh; sudo apt-get install nfs-common; exit; vagrant halt; vagrant up --provision;This will be fixed in Vagrant 1.5.
- Change into the Salty WordPress directory and run
vagrant up. This will take some time. Behind the scenes, Vagrant and Salt are downloading all of the system utilities (e.g. Nginx, PHP5-FPM, Memcached, etc.) to run your virtual machine.
- In your
/etc/hostsfile, point any domains you plan to work on to
192.168.50.10. The virtual machine is configured to handle all requests to
*.dev. The WordPress develop install, for instance, should be
- Access your virtual machine with
vagrant ssh. Windows users: You will see an output of the SSH info and the location of the key file instead. Feed this information into any SSH program, but not cmd.exe. Vagrant suggests PuTTY.
Navigate to http://wordpress-develop.dev in your browser to see a fully-functional WordPress install, powered by Salty WordPress. The default admin username/password is
Make your Salty WordPress experience even more awesome with these neat tricks.
- Deserialize data with
$~ serialize '[php serialized code]'
- Display a timestamp as a human readable string
$~ timestamp 1143123342[ouputs "2006-03-23T14:15:42+00:00"]
Open Remote Files in Sublime Text
However, for this functionality to work properly, you'll need to SSH into Vagrant using SSH (and port forwarding), not
vagrant ssh. Use
vagrant ssh-config (ref) to generate what you need to put in
~/.ssh/config. Then, add
RemoteForward 52698 127.0.0.1:52698 to the entry (ref).
Now, when you SSH into Vagrant, you'll automatically set up a connection for rmate to communicate to rsub (a Sublime Text plugin).
Localize Your Environment
Salty WordPress lets you localize your environment without having to edit tracked files. Create a local Salt file at
config/salt/local.sls and Vagrant will include any declarations in the next provision.
Alternatively, customize your Vagrantfile by including a
Customfile in Salty WordPress' base directory. You can include many declarations you might normally put in your Vagrantfile.
For instance, to more easily contribute to WP-CLI, use the following in your
Customfile to have WP-CLI loaded from a shared directory:
config.vm.synced_folder "wp-cli", "/home/vagrant/.wp-cli", :nfs => true
If you'd like to persist your databases between each destroy, you might want to put them in a mapped directory:
config.vm.synced_folder "databases", "/var/lib/mysql"
Note: You'll need to do an initial provision, then copy all of the files in
/var/lib/mysql to a "databases" directory in your local machine.
If you have the Vagrant Hosts Updater plugin installed you can add any additional hosts without having to edit
/etc/hosts. You may have to reload the VM to see the changes.
if defined?(VagrantPlugins::HostsUpdater) config.hostsupdater.aliases = [ "wordpress-develop.dev", ... ] end
For more information on how to contribute to this project, go here.