Install Kong OSS with PostgreSQL in Ubuntu Mate Impish 21.10 in Raspberry PI 4

  1. Download docker images
sudo docker pull arm64v8/kong
sudo docker pull arm64v8/postgres
  1. Start a PostgreSQL container
sudo docker run -d --name kong-database \
    -p 5432:5432 \
    -e "POSTGRES_USER=kong" \
    -e "POSTGRES_DB=kong" \
    -e "POSTGRES_PASSWORD=kong" \
    arm64v8/postgres:9.6
  1. Run the database migrations with an ephemeral Kong container
sudo docker run --rm \
    --link kong-database:kong-database \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_PG_USER=kong" \
    -e "KONG_PG_PASSWORD=kong" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
    arm64v8/kong kong migrations bootstrap
  1. Start Kong
sudo docker run -d --name kong \
    --link kong-database:kong-database \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_PG_PASSWORD=kong" \
    -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 \
    arm64v8/kong
  1. After reboot use the following commands to start the containers:
sudo docker container start kong-database
sudo docker container start kong

Ports:
8000 = HTTP Proxy
8001 = HTTP Admin API
8443 = HTTPS Proxy
8444 = HTTPS Admin API

References:
https://hub.docker.com/r/arm64v8/kong/
https://hub.docker.com/r/arm64v8/postgres/