×


Install Kong API Gateway on Ubuntu 20.04 - Step by Step Process ?

Kong Gateway is one of the most famous API Gateways in the Cloud Native world. It's used to manage the lifecycle of APIs and micro-services. API Gateways can do- Rate limiting, securing Your API with Key and tokens, logging and many more.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Cloud system queries.

In this context, we shall look into how to install Kong API Gateway on Ubuntu 20.04.


How to install Kong API Gateway on Ubuntu ?

To begin, we will download Kong API Gateway package by running the following command:

$ curl -Lo kong.2.5.0.amd64.deb "https://download.konghq.com/gateway-2.x-ubuntu-$(lsb_release -cs)/pool/all/k/kong/kong_2.5.0_amd64.deb"

Then, install the deb file by dpkg command:

$ sudo dpkg -i kong.2.5.0.amd64.deb

Here, we will not use a database (Kong will run in the DB-less mode). Run the following command to generate the config file for Kong:

$ kong config init

A config file name kong.yml will be created after running the above command. Let’s edit the kong.yml file as follow:

database = off
declarative_config: /home/ubuntu/kong.yml

How to Run Kong API ?

To start Kong, you can simply run the following command:

$ kong start -c kong.yml

To verify that Kong is running:

$ curl -i http://localhost:8001


[Need help in fixing Linux System issues ? We can help you. ]


Conclusion

This article covers how to install the KONG API Gateway on Ubuntu 20.04. These Gateways provides services like Authentication, rate-limiting, analysis, logging etc., to your API endpoints.

To Start kong API, run the following commands:

$ kong migrations up #runs the database migrations
$ sudo kong start
$ curl -i http://localhost:8001

To Stop and see status of kong API, run the following commands:

$ sudo kong stop #stop kong
$ sudo kong health #kong status