Open source api gateway – kong install in ubuntu 20. 04

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.

See also  How To start/Stop/Restart Network Service on Ubuntu or Debian Linux
$ sudo dpkg -i kong.2.7.0.amd64.deb

Open source api gateway – kong install in ubuntu 20. 04 1

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

Open source api gateway – kong install in ubuntu 20. 04 2

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.

See also  How to Install Yarn on Ubuntu 24.04
$ sudo kong start -c kong.yml

Open source api gateway – kong install in ubuntu 20. 04 3

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

Open source api gateway – kong install in ubuntu 20. 04 4

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!


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply