A development environment for Ghost using Vagrant.
You will need the following applications to setup the Ghost development environment:
Linux users will also need nfs-common and nfs-kernel-server:
sudo apt-get install nfs-common nfs-kernel-serverWindows users should install Vagrant to a directory with no spaces in the path.
To get started with the Ghost development environment, you will first need to clone this repo:
git clone git://github.com/TryGhost/Ghost-Vagrant.gitClone the Ghost repo into your new local Ghost-Vagrant repo:
cd Ghost-Vagrant
git clone git://github.com/Tryghost/Ghost.gitNow we have both repos cloned, we can proceed with setting up the VM:
vagrant upOnce the VM has been setup, you will need to log in to the VM and setup Ghost:
vagrant ssh
# When logged into the VM...
cd code/Ghost
npm install
grunt initOn the host you should now be able to access Ghost by navigating to local.tryghost.org or 192.168.33.10 in your browser. Make sure to update the development URL to http://local.tryghost.org in Ghost/config.js.
Once you have been through the setup process above, you can stop Ghost by logging in to the VM (vagrant ssh) and running:
sudo stop appTo start Ghost again run:
sudo start appIf you do not want to use the service for starting and stopping Ghost, you can alternatively run:
npm startThis is useful when you want to debug what Ghost is doing when it boots up, what URLs are being accessed etc.
You can configure various properties of the VM by creating a file named vm_config.yml in the Ghost-Vagrant root directory. The following properties are configurable:
- hostname - URI that will be used to access Ghost from the browser
- ip - IP address assigned to the virtual machine
- memory - Amount of memory the virtual machine should have
- ghost_path - Path to Ghost installation
hostname: local.tryghost.org
ip: 192.168.33.10
memory: 1024
ghost_path: ./GhostIf vm_config.yml is not present when you first run vagrant up, it will be automatically created with the default values found in .vm_config_default.yml.
See the working on Ghost core section of the Ghost contributing guide.
If grunt init fails due to an npm error EEXIST regarding a .lock file, try:
rm -rf core/client/node_modules
npm cache clear
grunt init
Copyright (c) 2013-2018 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.