Install and run Kong EE with PostgreSQL using Docker

  1. Pull the Kong Gateway and PostgreSQL 9.6 Docker images
sudo docker pull kong/kong-gateway
sudo docker pull postgres:9.6
  1. Create a Docker network
sudo docker network create kong-ee-net
  1. Start a database
sudo docker run -d --name kong-ee-database \
  --network=kong-ee-net \
  -p 5522:5432 \
  -e "POSTGRES_USER=kong" \
  -e "POSTGRES_DB=kong" \
  -e "POSTGRES_PASSWORD=kong" \
  postgres:9.6
  1. Prepare the Kong database
sudo docker run --rm --network=kong-ee-net \
  -e "KONG_DATABASE=postgres" \
  -e "KONG_PG_HOST=kong-ee-database" \
  -e "KONG_PG_PASSWORD=kong" \
  -e "KONG_PASSWORD=kong" \
  kong/kong-gateway kong migrations bootstrap
  1. Start the gateway with Kong Manager
sudo docker run -d --name kong-ee --network=kong-ee-net \
  -e "KONG_DATABASE=postgres" \
  -e "KONG_PG_HOST=kong-ee-database" \
  -e "KONG_PG_PASSWORD=kong" \
  -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" \
  -e "KONG_ADMIN_GUI_URL=http://localhost:8002" \
    -p 7000:8000 \
    -p 7443:8443 \
    -p 7001:8001 \
    -p 7444:8444 \
    -p 7002:8002 \
    -p 7445:8445 \
    -p 7003:8003 \
    -p 7004:8004 \
    kong/kong-gateway
  1. Verify your installation
curl -i -X GET --url http://localhost:7001/services
curl -i -X GET --url http://localhost:7001/endpoints
  1. Verify that Kong Manager (GUI) is running by accesing the following URL in a browser:
http://localhost:7002

Most probably you won't be able to use the GUI since you need to have a license for that, nonetheless you are ready to get one if you so desire, every is ready.

References: