Table of Contents
This guide walks through downloading, installing, and starting Kong Enterprise on Amazon Linux 2.
The configuration shown in this guide is intended as an example. Depending on your
environment, you may need to make modifications and take measures to properly conclude
the installation and configuration.
Kong supports both PostgreSQL 9.5+ and Cassandra 3.11.* as its datastore. This guide provides
steps to configure PostgreSQL. For assistance in setting up Cassandra, please contact your Sales or Support representative.
To complete this installation you will need:
- A valid Bintray account. You will need your username, account password and account API Key.
- Bintray Access key:
- Bintray username:
- Bintray password:
- Bintray API key:
- The API Key can be obtained by visiting https://bintray.com/profile/edit and selecting API Key
- A supported Amazon Linux 2 system with root equivalent access.
- A valid Kong Enterprise license JSON file, this can be found in your Bintray account. See Accessing Your License
Step 1. Prepare to Install Kong Enterprise and Download the License File
There are two options to install Kong Enterprise on Amazon Linux 2. Both require a login to Bintray.
Log in to Bintray. Your Kong Sales or Support contact will assign credentials to you.
Option 1: Download RPM File
- Go to: https://bintray.com/kong/kong-enterprise-edition-aws.
- Select the
aws folder. Kong Enterprise versions are listed in reverse chronological order.
- Select the latest Kong version from the list.
- From the Kong version detail page, select the Files tab and click the distribution folder.
- Save the RPM file available. For example,
Copy the RPM file to your home directory on the Amazon Linux 2 system. You may use a command like:
$ scp kong-enterprise-edition-188.8.131.52.aws.rpm <amazon user>@<server>:~
Optional: The following steps are for verifying the integrity of the package. They are not necessary to move on to installation.
Download Kong’s official public key to ensure the integrity of the RPM package:
$ curl -o kong.key https://bintray.com/user/downloadSubjectPublicKey?username=kong
$ sudo rpm --import kong.key
$ sudo rpm -K kong-enterprise-edition-184.108.40.206.aws.rpm
Verify you get an OK check. You should have an output similar to this:
kong-enterprise-edition-220.127.116.11.el7.noarch.rpm: sha1 md5 OK
Option 2: Download the Kong Repo File and Add to Yum Repo
Click this URL to download the Kong Enterprise RPM repo file: https://bintray.com/kong/kong-enterprise-edition-aws/rpm.
Edit the repo file using your preferred editor and alter the baseurl line as follows::
USERNAME with your Bintray account user name.
API_KEY with your Bintray API key. You can find your key on your Bintray profile page at https://bintray.com/profile/edit and selecting the API Key menu item.
The result should look something like this:
Securely copy the changed repo file to your home directory on the Amazon Linux 2 system. You may use a command such as:
$ scp bintray--kong-kong-enterprise-edition-aws.repo <amazon user>@<server>:~
Download your Kong Enterprise License
Download your license file from your account files in Bintray:
Securely copy the license file to your home directory on the Amazon Linux system. You may use a command like:
$ scp license.json <amazon username>@<server>:~
You should now have two files in your home directory on the target Amazon system:
- Either the Kong RPM or Kong Yum repo file.
- The license file
Step 2. Install Kong Enterprise
Option 1: If installing using a downloaded RPM package
Execute a command similar to the following, using the appropriate RPM file name you downloaded.
$ sudo yum install kong-enterprise-edition-18.104.22.168.aws.rpm
Option 2: If installing using the Yum repository
Move the repo file in your home directory to the /etc/yum.repos.d/ directory.
$ sudo mv bintray--kong-kong-enterprise-edition-aws.repo /etc/yum.repos.d/
Begin the installation using the Yum repository:
$ sudo yum update -y
$ sudo yum install kong-enterprise-edition -y
Copy the License File
Copy the license file from your home directory to the
$ sudo cp license.json /etc/kong/license.json
Step 3. Setup PostgreSQL
Follow the instructions avaialble at https://www.postgresql.org/download/linux/redhat/ to install a supported version of PostgreSQL. Kong supports version 9.5 and higher. As an example, you can run a command set similar to:
$ sudo amazon-linux-extras install postgresql9.6
$ sudo yum install postgresql postgresql-server
Initialize the PostgreSQL database and enable automatic start.
$ sudo /usr/bin/postgresql-setup --initdb
$ sudo systemctl enable postgresql.service
$ sudo systemctl start postgresql
Switch to PostgreSQL user and launch PostgreSQL.
$ sudo -i -u postgres
Create a Kong database with a username and password.
$ psql> CREATE USER kong; CREATE DATABASE kong OWNER kong; ALTER USER kong WITH password 'kong';
⚠️Note: Make sure the username and password for the Kong Database are
kept safe. This example uses a simple username and password for illustration purposes only. Note the database name, username and password for later.
Exit from PostgreSQL and return to your terminal account.
Edit the the PostgreSQL configuration file
/var/lib/pgsql/data/pg_hba.conf using your preferred editor.
Under IPv4 local connections replace
ident authentication by default. To allow the
kong user to communicate with the database locally, change the authentication method to
md5 by modifying the PostgreSQL configuration file.
$ sudo systemctl restart postgresql
Step 4. Modify Kong’s configuration file to work with PostgreSQL
Make a copy of Kong’s default configuration file.
$ sudo cp /etc/kong/kong.conf.default /etc/kong/kong.conf
Uncomment and update the PostgreSQL database properties in
/etc/kong/kong.conf using your preferred text editor. Replace
pg_database with the correct values.
pg_user = kong
pg_password = kong
pg_database = kong
Note: If you used different values for the user and database name, use those values for the user and database name.
Step 5. Seed the Super Admin password and bootstrap Kong
Setting a password for the Super Admin before initial start-up is strongly recommended. This will permit the use of RBAC (Role Based Access Control) at a later time, if needed.
Create an environment variable with the desired Super Admin password and keep password in a safe place:
$ export KONG_PASSWORD=<password-only-you-know>
Run migrations to prepare the Kong database:
$ sudo /usr/local/bin/kong migrations bootstrap -c /etc/kong/kong.conf
Start Kong Enterprise:
$ sudo /usr/local/bin/kong start -c /etc/kong/kong.conf
- Verify Kong Enterprise is working:
$ curl -i -X GET --url http://localhost:8001/services
- You should receive a
HTTP/1.1 200 OK message.
Step 6. Finalize Configuration and Verify Installation
Enable and Configure Kong Manager
To access Kong Enterprise’s Graphical User Interface, Kong Manager, update the
admin_gui_url property in
/etc/kong/kong.conf file to the DNS, or IP address, of the Amazon Linux system. For example:
admin_gui_url = http://<DNSorIP>:8002
This setting needs to resolve to a network path that will reach the Amazon Linux host.
It is necessary to update the administration API setting to listen on the needed network interfaces on the Amazon Linux host. A setting of
0.0.0.0:8001 will listen on port
8001 on all available network interfaces.
admin_listen = 0.0.0.0:8001, 0.0.0.0:8444 ssl
You may also list network interfaces separately as in this example:
admin_listen = 0.0.0.0:8001, 0.0.0.0:8444 ssl, 127.0.0.1:8001, 127.0.0.1:8444 ssl
Restart Kong for the setting to take effect:
$ sudo /usr/local/bin/kong restart
You may now access Kong Manager on port
Enable the Kong Developer Portal
Kong Enterprise’s Developer Portal can be enabled by setting the
portal property to
on and setting the
portal_gui_host property to the DNS, or IP address, of the Amazon Linux system. For example:
portal = on
portal_gui_host = <DNSorIP>:8003
Restart Kong for the setting to take effect:
$ sudo /usr/local/bin/kong restart
The final step is to enable the Developer Portal. To do this, execute the following command, updating
DNSorIP to reflect the IP or valid DNS for the Amazon Linux system.
$ curl -X PATCH http://<DNSorIP>:8001/workspaces/default --data "config.portal=true"
You can now access the Developer Portal on the default workspace with a URL like:
If you did not receive an
HTTP/1.1 200 OK message or need assistance completing
your setup, reach out to your Kong Support contact or go to the
Check out Kong Enterprise’s series of
Getting Started guides to get the most
out of Kong Enterprise.