Table of Contents
You can install Kong by downloading an installation package or using our apt repository
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 its configuration properties and a
file for specifying the entities as a declarative configuration.
Using a database
If you are using Postgres, please provision a database and a user before starting Kong, ie:
1 CREATE USER kong; CREATE DATABASE kong OWNER kong;
Now, run the Kong migrations:
1 $ kong migrations bootstrap [-c /path/to/kong.conf]
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
file in your current folder. It contains instructions about how to fill it up.
1 $ kong config init
After filling up the
kong.yml file, edit your
kong.conf file. Set the
off and the
declarative_config option to the path of your
1 2 database = off declarative_config = /path/to/kong.yml
rootand the worker processes as
kongby default. If this is not the desired behavior, you can switch the NGINX master process to run on the built-in
konguser or to a custom non-root user before starting Kong. For more information, see Running Kong as a Non-Root User.
1 $ kong start [-c /path/to/kong.conf]
Check that Kong is running:
1 $ curl -i http://localhost:8001/
Quickly learn how to use Kong with the 5-minute Quickstart.
Get future release notes emailed to you.