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:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Now, run the Kong migrations:
$ 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.
$ 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
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.
$ kong start [-c /path/to/kong.conf]
Check that Kong is running:
$ curl -i http://localhost:8001/
Quickly learn how to use Kong with the 5-minute Quickstart.