Categories: TutorialsUbuntu

Open Source API Gateway – Kong Install in Ubuntu 20.04

Kong gateway is one of the open source API gateway in the Cloud Native World. As it is an API gateway, it also sits in front of any API services and provides security and control. It is also used to manage the lifecycle of APIs and microservices. It provides services like Rate-limiting, Authentication, API keys, analysis, etc.

In this article, we are going to discuss the installation process of Kong API gateway on Ubuntu 20.04 LTS server.

Installation of Kong API gateway on Ubuntu 20.04

To install the Kong API gateway on Ubuntu 20.04 LTS server, firstly you have to download its respective package with the available version. Run the command as shown below to download the 2.7.0 version as it is the latest one at the time of writing this article.

$

Sponsored
curl -Lo kong.2.7.0.amd64.deb "https://download.konghq.com/gateway-2.x-ubuntu-focal/pool/all/k/kong/kong_2.7.0_amd64.deb"

After successfully downloading the package, use the dpkg command to install the deb file. Check the command as shown below for further details.

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

As shown on the above screenshot, we have successfully installed the Kong API gateway on the Ubuntu 20.04 LTS server.

Generating a config file for Kong

As Kong runs in a DB-less mode, we will not use a database in this case. For that,a config file for kong is to be generated. Simply, run the command as shown below to generate the config file for kong.

$ kong config init

After executing the above command, it will generate a config file named “kong.yml”.

It is the default kong.yml file generated after execution of the “kong config init” command.

Let’s edit some lines of the this file with the new one as shown below.

Sponsored
$ sudo vim kong.yml

database = off

declarative_config: /home/ubuntu/kong.yml

Running Kong API

As we have created a config file and edited a few lines of it. Now let’s start the Kong API with the command as shown below.

$ sudo kong start -c kong.yml

In the above screenshot, you are able to see that the kong API is started.

To further verify if Kong API is started or not, run the command as shown below.

$ curl -i http://localhost:8001

In the above screenshot, it is clear to see the Kong API is working.

Conclusion

In this article, you have learnt how to install and configure the Kong API gateway on Ubuntu 20.04 LTS server. It is one of the most used API gateway that is easy to install on the Ubuntu server. Thank you!

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

Web Engineering: Hack Week 2024

At Canonical, the work of our teams is strongly embedded in the open source principles…

5 hours ago

Ubuntu Weekly Newsletter Issue 873

Welcome to the Ubuntu Weekly Newsletter, Issue 873 for the week of December 29, 2024…

2 days ago

How to resolve WiFi Issues on Ubuntu 24.04

Have WiFi troubles on your Ubuntu 24.04 system? Don’t worry, you’re not alone. WiFi problems…

2 days ago

Remembering and thanking Steve Langasek

The following is a post from Mark Shuttleworth on the Ubuntu Discourse instance. For more…

2 days ago

How to Change Your Prompt in Bash Shell in Ubuntu

I don’t like my prompt, i want to change it. it has my username and…

2 days ago

The Silent Guardian: Why Bundler Checksums Are a Game-Changer for Your Applications

Introduction: A Fragile Trust The Ruby ecosystem relies heavily on RubyGems.org as the central platform…

3 days ago