Table of Contents
Start by downloading the corresponding package for your configuration:
Enterprise trial users should download their package from their welcome email and save their license to
/etc/kong/license.json after step 1.
You can also install Kong via YUM; follow the instructions on the “Set Me Up” section on the page below.
NOTE: ensure that the
baseurl field of the generated
.repo file contains
your CentOS version; for instance:
If you are downloading the package, execute:
$ sudo yum install epel-release $ sudo yum install kong-2.1.4.*.noarch.rpm --nogpgcheck
If you are using the repository, execute:
$ sudo yum update -y $ sudo yum install -y wget $ wget https://bintray.com/kong/kong-rpm/rpm -O bintray-kong-kong-rpm.repo $ export major_version=`grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d "." -f1` $ sed -i -e 's/baseurl.*/&\/centos\/'$major_version''/ bintray-kong-kong-rpm.repo $ sudo mv bintray-kong-kong-rpm.repo /etc/yum.repos.d/ $ sudo yum update -y $ sudo yum install -y 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.confconfiguration 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.confits configuration properties and a
kong.ymlfile for specifying the entities as a declarative configuration.
Using a database
If you are using PostgreSQL, please provision a database and a user, ie:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Now, run the Kong migrations:
$ kong migrations bootstrap [-c /path/to/kong.conf]
Note for Kong < 0.15: with Kong versions below 0.15 (up to 0.14), use the
upsub-command instead of
bootstrap. 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 declarative config file. The following command will generate a
kong.ymlfile in your current folder. It contains instructions about how to fill it up.
$ kong config init
After filling up the
kong.ymlfile, edit your
kong.conffile. Set the
declarative_configoption to the path of your
database = off declarative_config = /path/to/kong.yml
$ kong start [-c /path/to/kong.conf]
Kong is running:
$ curl -i http://localhost:8001/
Quickly learn how to use Kong with the 5-minute Quickstart.
Get future release notes emailed to you.