Databases 6 min read

Deploy Kingbase ES with Docker and Integrate It into Spring Boot

This guide walks through installing the Kingbase ES database via Docker, configuring persistence, adding the official driver to a Spring Boot project, adjusting the application.yml for PostgreSQL compatibility, and troubleshooting common container startup issues and SQL import procedures.

Dunmao Tech Hub
Dunmao Tech Hub
Dunmao Tech Hub
Deploy Kingbase ES with Docker and Integrate It into Spring Boot

Introduction

During a Spring Boot migration from PostgreSQL to the domestic Kingbase database, a series of steps are required to deploy Kingbase, configure persistence, and adjust the application settings.

What Is Kingbase?

Kingbase ES (KES) is a Chinese‑developed, enterprise‑grade relational database that supports transaction processing, data analysis, multi‑model data, and heterogeneous syntax compatibility, making it a mainstream choice for Chinese‑technology‑independent environments.

Environment Preparation

Docker Image Installation

The Kingbase website offers Windows, Linux, and Docker installation packages. The Docker image is preferred due to its smaller size.

Download the appropriate CPU‑architecture image, e.g., the x86_64 Linux package kdb_x86_64_V008R006C009B0014.tar . docker -i kdb_x86_64_V008R006C009B0014.tar Verify the import with: docker images Create a persistent data directory and set permissions:

# Create persistent data directory
mkdir -p /mnt/data
# Set read/write permissions
chmod -R 755 /mnt/data

Run the container with the required options:

docker run \
  -tid \
  --privileged \
  -p 4321:54321 \
  -v /mnt/data:/home/kingbase/userdata \
  -e NEED_START=yes \
  -e DB_USER=kingbase \
  -e DB_PASSWORD=123456 \
  -e DB_MODE=pg \
  -e ENABLE_CI=no \
  --name kingbase \
  kingbase_v008r006c009b0014_single_x86:v1 \
  /usr/sbin/init

The DB_MODE=pg setting selects PostgreSQL‑compatible mode. Confirm the container is running with:

docker ps
Docker container list
Docker container list
DockerSpringBootDatabase MigrationKingbasePostgreSQL Compatibility
Dunmao Tech Hub
Written by

Dunmao Tech Hub

Sharing selected technical articles synced from CSDN. Follow us on CSDN: Dunmao.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.