Install the dependencies
OpenResty 188.8.131.52. Kong being an OpenResty application, you must follow the OpenResty installation instructions. You will need OpenSSL and PCRE to compile OpenResty, and to at least use the following compilation options:
$ ./configure \ --with-pcre-jit \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_stub_status_module \ --with-http_v2_module
You might have to specify
--with-openssland you can add any other option you’d like, such as additional Nginx modules or a custom
$ export PATH="$PATH:/usr/local/openresty/bin"
Luarocks 2.4.3, compiled with the LuaJIT version bundled with OpenResty (See the
--with-lua-includeconfigure options). Example:
./configure \ --lua-suffix=jit \ --with-lua=/usr/local/openresty/luajit \ --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
Now that OpenResty is installed, we can use Luarocks to install Kong’s Lua sources:
$ luarocks install kong 1.1.0-0
$ git clone email@example.com:Kong/kong.git $ cd kong $ [sudo] make install # this simply runs the `luarocks make kong-*.rockspec` command
Finally, place the
bin/kongscript in your
Note: This step is required if you are using Cassandra; it is optional for Postgres users.
By default, Kong is configured to communicate with a local Postgres instance. If you are using Cassandra, or need to modify any settings, download the
kong.conf.defaultfile and adjust it as necessary. Then, as root, add it to
$ sudo mkdir -p /etc/kong $ sudo cp kong.conf.default /etc/kong/kong.conf
Prepare your database
If you are using Postgres, provision a database and a user before starting Kong:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Next, run the Kong migrations:
$ kong migrations bootstrap [-c /path/to/kong.conf]
Note for Kong < 0.15: with Kong versions below 0.15 (up to 0.14), use the
upsub-command instead of
bootstrap. Also note that with Kong < 0.15, migrations should never be run concurrently; only one Kong node should be performing migrations at a time. This limitation is lifted for Kong 0.15, 1.0, and above.
$ kong start [-c /path/to/kong.conf]
Verify that Kong is running:
$ curl -i http://localhost:8001/
Quickly learn how to use Kong with the 5-minute Quickstart.
Get future release notes emailed to you.