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

AI in 2025: is it an agentic year?

2024 was the GenAI year. With new and more performant LLMs and a higher number…

3 hours ago

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

1 day ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago