Last Updated: February 25, 2016
· rarous

Serving Jekyll site via Vagrant machine

In the root of your jekyll site create a Vagrantfile: do |config| = "precise32"
  config.vm.box_url = ""
  config.vm.forward_port 4000, 4000
  config.vm.provision :shell,
    :inline => "sudo apt-get update && sudo apt-get -y install build-essential git ruby1.9.3 && sudo gem install github-pages --no-ri --no-rdoc"

  config.ssh.forward_agent = true

Start the machine and connect to SSH:

$ vagrant up
$ vagrant ssh

Now, you can start Jekyll on the machine:

$ cd /vagrant/
$ jekyll serve -twP 4000

Your site is served on http://localhost:4000/ address.

When you are done just pres ctrl+c and then type exit.

1 Response
Add your response