Install Kong Gateway on macOS
See the MacOS
(latest version: 2.8.1)
Kong Gateway (OSS) is licensed under an
Apache 2.0 license.
You have a supported system with root or root-equivalent access.
Download and install
Install Kong Gateway:
Use the Homebrew package manager to add Kong as a tap and install it:
brew tap kong/kong
brew install kong
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’s configuration properties and a
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
Cassandra as datastores, and
can also run in DB-less mode
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]
By default, Kong is configured to communicate with a local Postgres instance.
If you are using Cassandra, or need to modify any settings, download the
kong.conf.default file and adjust it as necessary.
As root, add
sudo mkdir -p /etc/kong
sudo cp kong.conf.default /etc/kong/kong.conf
Without a database
If you are going to run Kong in DB-less mode,
you should start by generating a declarative config file.
kong.yml file in your current folder using the following command:
The file contains instructions about how to populate it.
kong.conf file. Set the
off and the
declarative_config option to the path of your
database = off
declarative_config = /path/to/kong.yml
Run Kong Gateway
Start Kong Gateway:
kong start [-c /path/to/kong.conf]
Verify that Kong Gateway is running:
curl -i http://localhost:8001/
Check out Kong Gateway’s series of
Getting Started guides to get the most
out of Kong Gateway.