How to restart Kong Gateway in a Docker container

Uses: Kong Gateway
Incompatible with
konnect
Related Documentation
Tags
Minimum Version
Kong Gateway - 3.4
TL;DR

Use kong reload.

Prerequisites

This tutorial requires Kong Gateway Enterprise. If you don’t have Kong Gateway set up yet, you can use the quickstart script with an enterprise license to get an instance of Kong Gateway running almost instantly.

  1. Export your license to an environment variable:

     export KONG_LICENSE_DATA='LICENSE-CONTENTS-GO-HERE'
  2. Run the quickstart script:

    curl -Ls https://get.konghq.com/quickstart | bash -s -- -e KONG_LICENSE_DATA 

    Once Kong Gateway is ready, you will see the following message:

     Kong Gateway Ready

Restart a Kong Gateway Docker container

To restart a Kong Gateway container without killing the container, run kong reload from within the container. In this example, the container is named kong-quickstart-gateway:

docker exec kong-quickstart-gateway kong reload

If Kong Gateway runs on Kubernetes, don’t use kong reload. See Restart Kong Gateway on Kubernetes instead.

FAQs

kong restart kills the pid, which will kill the container.

Reload after changing any value in kong.conf, or after changing a file that a kong.conf parameter points to. These values are rendered into the NGINX configuration at startup, so Kong Gateway doesn’t detect changes to them while it’s running.

You don’t need to reload after changing configuration entities such as Services, Routes, plugins, or Certificates. Those are read from the configuration cache on every update.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!