Skip to main content

Getting started

You can either get started with Apache Kvrocks™ with Docker or compile a binary from source.

Run Kvrocks with Docker

  1. Follow Docker's installation instructions to install Docker.
  2. Pull the latest image and start a container:
docker run -it -p 6666:6666 apache/kvrocks --bind

Now you can use the redis-cli to run the kvrocks server as Redis on port 6666:

redis-cli -p 6666

For persisted data, prefer using a docker volume over a bind-mounted volume to avoid file permission or performance problems. Eg:

# create docker volume once, eg:
docker volume create kvrocks_data

docker run --volume kvrocks_data:/kvrocks_data \
--interactive --tty --publish 6666:6666 apache/kvrocks:2.7.0 --bind --dir /kvrocks_data

# note: the default data dir is /var/lib/kvrocks. The above example changes the location from default to /kvrocks_data.

Tuning Docker

Any command line switches in the the Docker CMD position are passed to the kvrocks app. For example, to change the "workers" setting from default to 16, you could include --workers 16

docker run -it --rm -p 6666:6666 apache/kvrocks --bind --workers 16

To set an admin password, use the requirepass directive:

# assuming password exported on environment variable "KVROCKS_ADMIN_SECRET":
docker run -it --rm -p 6666:6666 apache/kvrocks --bind --requirepass $KVROCKS_ADMIN_SECRET

# redis-cli on host looks like:

Alternatively, you might mount the entire kvrocks.conf file to the container. The default config location is /var/lib/kvrocks/kvrocks.conf. NOTE: if bind-mounting, it must be an entire directory (and so would look like ./my_conf_dir:/var/lib/kvrocks.) To change the config file location, override the Docker entrypoint. (See Dockerfile as a guideline.)

Build and run Kvrocks from source

Install dependencies

sudo yum install -y centos-release-scl-rh
sudo yum install -y git devtoolset-11 autoconf automake libtool libstdc++-static python3 openssl-devel
# download and install cmake via
wget -O
sudo bash --skip-license --prefix=/usr
# enable gcc and make in devtoolset-11
source /opt/rh/devtoolset-11/enable

Compile Kvrocks from source

git clone
cd kvrocks
./ build # `./ build -h` to check more options;
# especially, `./ build --ghproxy` will fetch dependencies via

The binary file kvrocks will be generated at build dir if everything goes well.

Run the Kvrocks server by:

./build/kvrocks -c kvrocks.conf

Now you can use the redis-cli to run the kvrocks server as Redis on port 6666:

redis-cli -p 6666