Table of Contents
Packages
Installation
-
Install Kong
Use the Homebrew package manager to add Kong as a tap and install it:
$ brew tap kong/kong $ brew install kong
-
Prepare your database or declarative configuration file
Kong can run either with or without a database.
When using a database, you will use the
kong.conf
configuration file for setting Kong’s configuration properties at start-up and the database as storage of all configured entities, such as the Routes and Services to which Kong proxies.When not using a database, you will use
kong.conf
’s configuration properties and akong.yml
file for specifying the entities as a declarative configuration.Using a database
Configure Kong so it can connect to your database. Kong supports PostgreSQL 9.5+ and Cassandra 3.x.x as datastores, and can also run in DB-less mode
If you are using Postgres, provision a database and a user before starting Kong:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Next, run the Kong migrations:
$ kong migrations bootstrap [-c /path/to/kong.conf]
By default, Kong is configured to communicate with a local Postgres instance. If you are using Cassandra, or need to modify any settings, download the
kong.conf.default
file and adjust it as necessary. Then, as root, addkong.conf.default
to/etc
:$ sudo mkdir -p /etc/kong $ sudo cp kong.conf.default /etc/kong/kong.conf
Note for Kong < 0.15: with Kong versions below 0.15 (up to 0.14), use the
up
sub-command instead ofbootstrap
. Also note that with Kong < 0.15, migrations should never be run concurrently; only one Kong node should be performing migrations at a time. This limitation is lifted for Kong 0.15, 1.0, and above.Without a database
If you are going to run Kong in DB-less mode, you should start by generating a declarative config file. The following command will generate a
kong.yml
file in your current folder. It contains instructions about how to populate it.$ kong config init
After populating the
kong.yml
file, edit yourkong.conf
file. Set thedatabase
option tooff
and thedeclarative_config
option to the path of yourkong.yml
file:database = off declarative_config = /path/to/kong.yml
-
Start Kong
$ kong start [-c /path/to/kong.conf]
-
Use Kong
Verify that Kong is running:
$ curl -i http://localhost:8001/
Quickly learn how to use Kong with the 5-minute Quickstart.
Follow Up:
Get future release notes emailed to you.