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.
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-net3.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.63.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 bootstrapThis 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:latest3.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.64.2.2 Initialize Konga Database
docker run --rm --network=kong-net \
pantsel/konga:latest -c prepare -a postgres \
-u postgres://konga@konga-database:5432/konga4.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/kongaAfter 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
