CLI Reference

    • , --help: print the command’s help message
    • --v: enable verbose mode
    • --vv: enable debug mode (noisy)

    Available commands


    kong config

    1. Usage: kong config COMMAND [OPTIONS]
    2. Use declarative configuration files with Kong.
    3. The available commands are:
    4. init [<file>] Generate an example config file to
    5. get you started. If a filename
    6. is not given, ./kong.yml is used
    7. by default.
    8. db_import <file> Import a declarative config file into
    9. the Kong database.
    10. db_export [<file>] Export the Kong database into a
    11. declarative config file. If a filename
    12. is not given, ./kong.yml is used
    13. by default.
    14. parse <file> Parse a declarative config file (check
    15. its syntax) but do not load it into Kong.
    16. Options:
    17. -c,--conf (optional string) Configuration file.
    18. -p,--prefix (optional string) Override prefix directory.

    kong health

    1. Usage: kong health [OPTIONS]
    2. Check if the necessary services are running for this node.
    3. Options:
    4. -p,--prefix (optional string) prefix at which Kong should be running

    kong hybrid

    1. Usage: kong hybrid COMMAND [OPTIONS]
    2. Hybrid mode utilities for Kong.
    3. The available commands are:
    4. gen_cert [<cert> <key>] Generate a certificate/key pair that is suitable
    5. for use in hybrid mode deployment.
    6. Cert and key will be written to
    7. './cluster.crt' and './cluster.key' inside
    8. the current directory unless filenames are given.
    9. -d,--days (optional number) Override certificate validity duration.
    10. Default: 1095 days (3 years)


    kong prepare

    1. Usage: kong prepare [OPTIONS]
    2. Prepare the Kong prefix in the configured prefix directory. This command can
    3. be used to start Kong from the nginx binary without using the 'kong start'
    4. command.
    5. Example usage:
    6. kong migrations up
    7. kong prepare -p /usr/local/kong -c kong.conf
    8. nginx -p /usr/local/kong -c /usr/local/kong/nginx.conf
    9. Options:
    10. -c,--conf (optional string) configuration file
    11. -p,--prefix (optional string) override prefix directory
    12. --nginx-conf (optional string) custom Nginx configuration template

    kong quit

    1. Usage: kong quit [OPTIONS]
    2. Gracefully quit a running Kong node (Nginx and other
    3. configured services) in given prefix directory.
    4. This command sends a SIGQUIT signal to Nginx, meaning all
    5. requests will finish processing before shutting down.
    6. If the timeout delay is reached, the node will be forcefully
    7. stopped (SIGTERM).
    8. Options:
    9. -p,--prefix (optional string) prefix Kong is running at
    10. -t,--timeout (default 10) timeout before forced shutdown
    11. -w,--wait (default 0) wait time before initiating the shutdown

    kong reload

    1. Usage: kong reload [OPTIONS]
    2. Reload a Kong node (and start other configured services
    3. if necessary) in given prefix directory.
    4. This command sends a HUP signal to Nginx, which will spawn
    5. new workers (taking configuration changes into account),
    6. and stop the old ones when they have finished processing
    7. current requests.
    8. Options:
    9. -c,--conf (optional string) configuration file
    10. -p,--prefix (optional string) prefix Kong is running at
    11. --nginx-conf (optional string) custom Nginx configuration template


    kong runner

    1. Execute a lua file in a kong node. the `kong` variable is available to
    2. reach the DAO, PDK, etc. The variable `args` can be used to access all
    3. arguments (args[1] being the lua filename being run).
    4. Example usage:
    5. kong runner file.lua arg1 arg2
    6. echo 'print("foo")' | kong runner

    kong start

    1. Usage: kong start [OPTIONS]
    2. Start Kong (Nginx and other configured services) in the configured
    3. prefix directory.
    4. Options:
    5. -c,--conf (optional string) Configuration file.
    6. -p,--prefix (optional string) Override prefix directory.
    7. --nginx-conf (optional string) Custom Nginx configuration template.
    8. --run-migrations (optional boolean) Run migrations before starting.
    9. --db-timeout (default 60) Timeout, in seconds, for all database
    10. operations (including schema consensus for
    11. Cassandra).
    12. --lock-timeout (default 60) When --run-migrations is enabled, timeout,
    13. in seconds, for nodes waiting on the
    14. leader node to finish running migrations.

    kong stop

    1. Usage: kong stop [OPTIONS]
    2. Stop a running Kong node (Nginx and other configured services) in given
    3. prefix directory.
    4. This command sends a SIGTERM signal to Nginx.
    5. Options:
    6. -p,--prefix (optional string) prefix Kong is running at


    kong version

    1. Usage: kong version [OPTIONS]
    2. Print Kong's version. With the -a option, will print
    3. the version of all underlying dependencies.
    4. Options:
    5. -a,--all get version of all dependencies