You are browsing documentation for an older version. See the latest documentation here.

Install Kong Gateway on Ubuntu

The Kong Gateway software is governed by the Kong Software License Agreement. Kong is licensed under an Apache 2.0 license.

This page guides you through installing Kong Gateway in traditional mode, where it acts as both the control plane and data plane. Running in this mode may have a small performance impact.

We recommend using Konnect as your control plane to allow your data plane to run at maximum performance and decrease your deployment complexity.

Prerequisites

Once you have everything you need, choose an installation path:

Notes:

Installation

The quickest way to get started with Kong Gateway is using the install script:

Kong Gateway

Kong Gateway (OSS)

  1. bash <(curl -sS https://get.konghq.com/install) -v 3.7.1.2
  1. bash <(curl -sS https://get.konghq.com/install) -p kong -v 3.7.1

This script detects your operating system and automatically installs the correct package. It also installs a PostgreSQL database and bootstraps Kong Gateway for you.

If you’d prefer to install just the Kong Gateway package, see the Package Install section.

Verify install

Once the script completes, run the following in the same terminal window:

  1. curl -i http://localhost:8001

You should receive a 200 status code.

Next steps

Once Kong Gateway is running, you may want to do the following:

Advanced installation

Package install

You can install Kong Gateway by downloading an installation package or using the APT repository.

The following steps install the package only, without a data store. You will need to set one up after installation.

Package

APT repository

Install Kong Gateway on Ubuntu from the command line.

  1. Download the Kong package.

    We currently package Kong Gateway for Ubuntu Focal and Jammy. The following command assumes you’re running jammy. If you are using a different release, replace jammy with $(lsb_release -sc) or the release name in the command below. To check your release name, run lsb_release -sc.

    Kong Gateway

    Kong Gateway (OSS)

    1. curl -Lo kong-enterprise-edition-3.7.1.2.deb "https://packages.konghq.com/public/gateway-37/deb/ubuntu/pool/jammy/main/k/ko/kong-enterprise-edition_3.7.1.2/kong-enterprise-edition_3.7.1.2_$(dpkg --print-architecture).deb"
    1. curl -Lo kong-3.7.1.deb "https://packages.konghq.com/public/gateway-37/deb/ubuntu/pool/jammy/main/k/ko/kong_3.7.1/kong_3.7.1_$(dpkg --print-architecture).deb"
  2. Install the package:

    Kong Gateway

    Kong Gateway (OSS)

    1. sudo apt install -y ./kong-enterprise-edition-3.7.1.2.deb
    1. sudo apt install -y ./kong-3.7.1.deb

Install the APT repository from the command line.

  1. Set up the Kong APT repository.

    We currently package Kong Gateway for Ubuntu Focal and Jammy. The following command assumes you’re running jammy. If you are using a different release, replace jammy with $(lsb_release -sc) or the release name in the command below. To check your release name, run lsb_release -sc.

    1. curl -1sLf "https://packages.konghq.com/public/gateway-37/gpg.C05D9BEAEB9E8E18.key" | gpg --dearmor | sudo tee /usr/share/keyrings/kong-gateway-37-archive-keyring.gpg > /dev/null
    2. curl -1sLf "https://packages.konghq.com/public/gateway-37/config.deb.txt?distro=ubuntu&codename=jammy" | sudo tee /etc/apt/sources.list.d/kong-gateway-37.list > /dev/null
  2. Update the repository:

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

    Kong Gateway

    Kong Gateway (OSS)

    1. sudo apt-get install -y kong-enterprise-edition=3.7.1.2
    1. sudo apt-get install -y kong=3.7.1
  4. Optional: Prevent accidental upgrades by marking the package as hold:

    Kong Gateway

    Kong Gateway (OSS)

    1. sudo apt-mark hold kong-enterprise-edition
    1. sudo apt-mark hold kong

Next steps

Before starting Kong Gateway, set up a data store and update the kong.conf.default configuration property file with a reference to your data store.

Depending on your desired environment, also see the following guides:

You can also check out Kong Gateway’s series of Getting Started guides to learn how get the most out of Kong Gateway.

Uninstall package

Stop Kong Gateway:

  1. kong stop

Kong Gateway

Kong Gateway (OSS)

To uninstall the package, run:

  1. sudo apt remove kong-enterprise-edition

To uninstall the package, run:

  1. sudo apt remove kong