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!

Ubuntu Server Admin

Recent Posts

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

20 hours ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

20 hours ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

20 hours ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

2 days ago

Revolutionizing Web Page Creation: How Structured Content is Slashing Design and Development Time

Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…

3 days ago

Ubuntu Weekly Newsletter Issue 897

Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…

4 days ago