Install and Deploy TiKV Using Docker Compose

This guide describes how to quickly deploy a TiKV testing cluster using Docker Compose on a single machine.


Currently, this installation method only supports the Linux system.


Make sure you have installed the following items on your machine:

  • Docker (17.06.0 or later) and Docker Compose

    sudo yum install docker docker-compose
  • Helm

    curl | bash
  • Git

    sudo yum install git

Install and deploy

  1. Download tidb-docker-compose.

    git clone
  2. Edit the compose/values.yaml file to configure networkMode to host.

    cd tidb-docker-compose
    vim compose/values.yaml  
  3. Edit the compose/values.yaml file to comment the TiDB section out.

  4. Change the Prometheus and Pushgateway addresses for the host network mode.

    sed -i 's/pushgateway:9091/' config/*
    sed -i 's/prometheus:9090/' config/*
  5. Generate the generated-docker-compose.yml file.

    helm template compose > generated-docker-compose.yml
  6. Create and start the cluster using the generated-docker-compose.yml file.

    docker-compose -f generated-docker-compose.yml pull # Get the latest Docker images
    docker-compose -f generated-docker-compose.yml up -d

You can check whether the TiKV cluster has been successfully deployed using the following command:

curl localhost:2379/pd/api/v1/stores

If the state of all the TiKV instances is “Up”, you have successfully deployed a TiKV cluster.

What's next?

If you want to try the Go client, see Try Two Types of APIs.