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.

  1. Download the Kong package:

    1. 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"
  2. Install the package:

    1. sudo dpkg -i kong-2.6.0.amd64.deb

Install the APT repository from the command line.

  1. Download the Kong APT repository:

    1. echo "deb [trusted=yes] https://download.konghq.com/gateway-2.x-debian-$(lsb_release -sc)/ \
    2. default all" | sudo tee /etc/apt/sources.list.d/kong.list
  2. Update the repository:

    1. sudo apt-get update
  3. Install Kong:

    1. 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.

  1. If you are using Postgres, provision a database and a user before starting Kong:

    1. CREATE USER kong; CREATE DATABASE kong OWNER kong;
  2. 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.

  1. Generate a kong.yml file in your current folder using the following command:

    1. kong config init

    The file contains instructions about how to populate it.

  2. Edit your kong.conf file. Set the database option to off and the declarative_config option to the path of your kong.yml file:

    1. database = off
    2. 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 as kong by default. If this is not the desired behavior, you can switch the NGINX master process to run on the built-in kong user or to a custom non-root user before starting Kong. For more information, see Running Kong as a Non-Root User.

  1. Start Kong Gateway:

    1. kong start [-c /path/to/kong.conf]
  2. Check that Kong Gateway is running:

    1. 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.