Vagrant can be used to create an isolated environment for Kong and its dependencies.

You can use the Vagrant box either as an all-in-one Kong installation for testing purposes, or you can link it up with source code and start developing on Kong or on custom plugins.

Here is a quick example showing how to build a (disposable) test setup:

  1. Get the Vagrantfile and start the VM

     $ git clone
     $ cd kong-vagrant/
     $ vagrant up
  2. Start Kong

    The default Vagrantfile will install both PostgreSQL and Cassandra. PostgreSQL is the default:

     # specify migrations flag to initialise the datastore
     $ vagrant ssh -c "kong start --run-migrations"

    Cassandra is available via a setting:

     $ vagrant ssh -c "KONG_DATABASE=cassandra kong start --run-migrations"

    To start Kong in DB-less mode, use this:

     $ vagrant ssh -c "KONG_DATABASE=off kong start"

    If you want to include a declarative configuration file, put it inside a ./kong/kong.yml folder, and it will be available through the /kong/kong.yml path in Vagrant:

     $ vagrant ssh -c "KONG_DECLARATIVE_CONFIG=/kong/kong.yml KONG_DATABASE=off kong start"

    The host ports 8000, 8001, 8443, and 8444 will be forwarded to the Vagrant box.

    Note: Check out the kong-vagrant repository for further details on customizations and development.
  3. Use Kong

    Kong is running:

     $ curl

    Quickly learn how to use Kong with the 5-minute Quickstart.

Having Trouble? We're here to help!