How to run Kong servers with SystemD

Kong is one of my favourite projects, I do like it and keep pushing my current company and most of who I know to use it. So today I’ll talk about installing version 0.10.x and how to run it automatically via SystemD on Ubuntu 16.04.

Let’s talk about installing Kong, basically, we have two steps:

First, installing Kong (this taken from the docs):

This will install Kong correctly on your server successfully.

Second, we need to install PostgreSQL:

Then switch to postgres user:

and run psql to enter PostgreSQL prompt and create kong user and kong database:

once you are inside the prompt run the following:

the last thing is to specify the password for kong user, run the command:

Remember you will have to run all those while you are within psql prompt.

Now you are ready to configure Kong, and it’s simple :

once you are finished with the configuration, you are ready to run Kong, just execute the command:

Now our next mission is to create the service file which will give SystemD the ability to run Kong automatically

and add the following:

Finally, enable Kong with systemd by running:


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.