Install Kong Gateway on Debian
Download the latest Kong 2.6.x package for Debian:
(latest version: 2.6.0)
View the list of all 2.x packages for 9 Stretch, 10 Buster, or 11 Bullseye
Kong is licensed under an Apache 2.0 license.
Prerequisites
You have a supported system with root or root-equivalent access.
Download and install
You can install Kong Gateway by downloading an installation package or using our APT repository.
Package
APT repository
Install Kong Gateway on Debian from the command line.
Download the Kong package:
curl -Lo kong-2.6.0.amd64.deb "https://download.konghq.com/gateway-2.x-debian-$(lsb_release -cs)/pool/all/k/kong/kong_2.6.0_amd64.deb"
Install the package:
sudo dpkg -i kong-2.6.0.amd64.deb
Install the APT repository from the command line.
Download the Kong APT repository:
echo "deb [trusted=yes] https://download.konghq.com/gateway-2.x-debian-$(lsb_release -sc)/ \
default all" | sudo tee /etc/apt/sources.list.d/kong.list
Update the repository:
sudo apt-get update
Install Kong:
apt install -y kong=2.6.0
Prepare your configs
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 kong.yml
file for specifying the entities as a declarative configuration.
Using a database
Deprecation warning: Cassandra as a backend database for Kong Gateway is deprecated. This means the feature will eventually be removed.
Our target for Cassandra removal is the Kong Gateway 4.0 release. Starting with the Kong Gateway 3.0 release, some new features might not be supported with Cassandra.
Configure Kong so it can connect to your database. Kong supports both PostgreSQL and Cassandra as its datastore.
If you are using Postgres, provision a database and a user before starting Kong:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
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.
Generate a
kong.yml
file in your current folder using the following command:kong config init
The file contains instructions about how to populate it.
Edit your
kong.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
Run Kong Gateway
Note: When you start Kong, the NGINX master process runs as
root
and the worker processes askong
by default. If this is not the desired behavior, you can switch the NGINX master process to run on the built-inkong
user or to a custom non-root user before starting Kong. For more information, see Running Kong as a Non-Root User.
Start Kong Gateway:
kong start [-c /path/to/kong.conf]
Check that Kong Gateway is running:
curl -i http://localhost:8001/
Next steps
Check out Kong Gateway’s series of Getting Started guides to get the most out of Kong Gateway.