Skip to content

A simple solution for local WordPress development within a VM (uses Laravel's homestead).

Notifications You must be signed in to change notification settings

lasergoat/homepress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Homepress

A simple approach to local development for WordPress. Using this tool, you'll get a per-project installation of WordPress using Laravel's Homestead.

NOTE: Homepress can install a VM whether or not you use Wordpress! Look below at the "Other Commands" section.

Installation

Have the requirements met below, then simply run:

npm install -g homepress
homepress start

During install, Homestead will ask if you want to add your new local dev site IP address to your hosts file. Hint: you do.

Requirements

Have Node/NPM, Virtual Box and Vagrant

If you already have node, update it:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Also Have Composer

Install composer globally:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

If you already had composer, update it! composer self-update.

Other Commands

Init Everything: homepress start OR homepress init

Update your WordPress Version: homepress wp-update

Generate new WordPress salts: homepress wp-salts

Install VM Only (because you already have WordPress): homepress vm-init

Start the VM: vagrant up

Stop/Halt the VM: vagrant halt

SSH into the VM: vagrant ssh

Bonus: Connecting to MySQL Manually

If you use a tool like Sequel Pro, you'll want to use these connection settings to connect to Mysql within the VM.

Setup connection details:

  • Use an SSH connection (not standard)
  • MySQL Host: 10.0.2.15
  • User: homestead
  • Password: secret
  • Database: homestead
  • Port: blank
  • SSH Host: 192.168.10.10**
  • SSH User: vagrant
  • SSH Key: ~/.ssh/id_rsa (this is your host computer key)
  • SSH Port: blank

** This IP is what you typed in during homepress start when it asked which IP you want your VM to live at.

Development

To develop and test this locally, simply do this:

git clone https://github.com/lasergoat/homepress.git
cd homepress
npm install
cd ../
mkdir test
cd test

Then, every time you edit a file in homepress, run this command:

cd ../homepress && npm link && cd ../test && homepress start

This will avoid creating vm and WordPress files within the homepress directory

About

A simple solution for local WordPress development within a VM (uses Laravel's homestead).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published