Cloud Native 9 min read

How to Quickly Set Up Kong API Gateway and Konga UI with Docker

This guide walks you through installing Kong API gateway and its open‑source management UI Konga using Docker, covering network creation, database selection, container configuration, migration, verification, and final UI access, all with clear commands and examples.

Programmer DD
Programmer DD
Programmer DD
How to Quickly Set Up Kong API Gateway and Konga UI with Docker

1. Introduction

Today we will set up a Kong environment to facilitate further learning and experimentation.

2. Kong Supported Environments

Kong runs on Linux, macOS, containers, and cloud platforms. For Windows developers we use Docker for installation.

3. Install Kong

Kong requires a Docker environment. We use the database‑backed mode for full functionality.

3.1 Create Docker Network

docker network create kong-net

3.2 Set Up Database Container

You can choose Cassandra or PostgreSQL. Below are the PostgreSQL commands with a persistent volume.

docker volume create kong-volume
docker run -d --name kong-database \
  --network=kong-net \
  -p 5432:5432 \
  -v kong-volume:/var/lib/postgresql/data \
  -e "POSTGRES_USER=kong" \
  -e "POSTGRES_DB=kong" \
  postgres:9.6

3.3 Initialize / Migrate Database

docker run --rm \
  --network=kong-net \
  -e "KONG_DATABASE=postgres" \
  -e "KONG_PG_HOST=kong-database" \
  -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
  kong:latest kong migrations bootstrap

This command must match the network name, database type, and host.

3.4 Start Kong Container

docker run -d --name kong \
  --network=kong-net \
  -e "KONG_DATABASE=postgres" \
  -e "KONG_PG_HOST=kong-database" \
  -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
  -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
  -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
  -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
  -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
  -e "KONG_ADMIN_LISTEN=0.0.0.0:8001,0.0.0.0:8444 ssl" \
  -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 \
  kong:latest

3.5 Verify Installation

Run curl -i http://localhost:8001/ or open http://localhost:8001/ in a browser to confirm Kong Admin is reachable.

4. Install Kong Management UI (Konga)

Konga is an open‑source UI for Kong, built with AngularJS and Node.js.

4.1 Konga Features

Manage all Kong Admin API objects.

Import users from remote sources.

Handle multiple Kong nodes with snapshot backup and migration.

Monitor node and API health.

Email and idle notifications.

Multi‑user support.

Easy integration with MySQL, PostgreSQL, MongoDB, SQL Server.

4.2 Docker Install Konga

4.2.1 Konga Database Container

docker run -d --name konga-database \
  --network=kong-net \
  -p 5433:5432 \
  -v konga-postgresql:/var/lib/postgresql/data \
  -e "POSTGRES_USER=konga" \
  -e "POSTGRES_DB=konga" \
  -e "POSTGRES_PASSWORD=konga" \
  postgres:9.6

4.2.2 Initialize Konga Database

docker run --rm --network=kong-net \
  pantsel/konga:latest -c prepare -a postgres \
  -u postgres://konga@konga-database:5432/konga

4.2.3 Start Konga

docker run -d -p 1337:1337 \
  --network kong-net \
  -e "DB_ADAPTER=postgres" \
  -e "DB_URI=postgres://konga@konga-database:5432/konga" \
  -e "NODE_ENV=production" \
  -e "DB_PASSWORD=konga" \
  --name konga \
  pantsel/konga

After the container starts, access the UI at http://localhost:1337, register, and add the Kong Admin API URL (e.g., http://<em>your‑host</em>:8001) to the dashboard.

5. Summary

This article detailed the installation of Kong and the Konga UI using Docker, covering network setup, database configuration, container deployment, migration, verification, and UI access.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Dockerapi-gatewayContainerPostgreSQLKongKonga
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.