Deploy seekdb in a container environment
This topic describes how to deploy seekdb through Docker containers.
Overview
The seekdb Docker image is available from dockerhub, quay.io, and ghcr.io, and is designed to help users quickly set up a seekdb environment for testing.
- When running this image on macOS with Intel chips, there is a known issue if the Docker version is higher than 4.9.0. You can download the required version of Docker here.
- This image is for testing only; do not use it in production environments.
Prerequisites
Before deploying seekdb, ensure that the following requirements are met:
-
Docker is installed and the Docker service is started. For details, see Docker documentation.
-
Your machine has at least 1 physical core and 2 GB of memory.
Start a seekdb instance
To start a seekdb instance, use the following command:
docker run -d -p 2881:2881 oceanbase/seekdb
If pulling the Docker image fails, you can also pull the image from the quay.io or ghcr.io repository by replacing
oceanbase/seekdbin the above command withquay.io/oceanbase/seekdborghcr.io/oceanbase/seekdb, for example, runsudo docker run -d -p 2881:2881 quay.io/oceanbase/seekdbto pull the image from quay.io.The above command pulls the latest version by default. You can select a version from dockerhub, quay.io, or ghcr.io according to your actual needs.
If you want to execute initialization SQL scripts after startup, you need to mount a directory containing initialization scripts and then specify the mounted directory in the container through the environment variable INIT_SCRIPTS_PATH. Example command:
docker run -d -p 2881:2881 -v {init_sql_folder_path}:/root/boot/init.d -e INIT_SCRIPTS_PATH=/root/boot/init.d oceanbase/seekdb
In the command, {init_sql_folder_path} is the path to the initialization SQL scripts on the host machine.
Do not change the root user password in SQL scripts. If you want to change the root user password, use the environment variable ROOT_PASSWORD, for example: docker run -d -p 2881:2881 -e ROOT_PASSWORD="******" oceanbase/seekdb.
The supported environment variables are as follows:
| Variable name | Description | Default value |
|---|---|---|
| ROOT_PASSWORD | Password for the root user. | Empty by default |
| CPU_COUNT | Value of cpu_count. | 4 |
| MEMORY_LIMIT | Value of memory_limit. | 2G |
| LOG_DISK_SIZE | Value of log_disk_size. | 2G |
| DATAFILE_SIZE | Value of datafile_size. | 2G |
| DATAFILE_NEXT | Value of datafile_next. | 2G |
| DATAFILE_MAXSIZE | Value of datafile_maxsize. | 50G |
| INIT_SCRIPTS_PATH | Path to initialization scripts in the container. | \ |
If you want to modify more seekdb parameters, you can deploy seekdb using a configuration file.
You can mount the configuration file to /etc/oceanbase/seekdb.cnf in the container.
- Create a configuration file on the host server. The default configuration file is as follows:
datafile_size=2G
datafile_next=2G
datafile_maxsize=50G
cpu_count=4
memory_limit=8G
log_disk_size=2G
# config the parameter in the following format
# key=value
- Start seekdb.
docker run -d -p 2881:2881 -v {config_file}:/etc/oceanbase/seekdb.cnf oceanbase/seekdb
In the command, {config_file} is the path to the configuration file on the host machine.
If you decide to use a configuration file, do not specify resource-related environment variables.
Data persistence
seekdb is deployed in the /var/lib/oceanbase directory. If you want to persist data to the host server, mount an empty directory on the host server to this path.
mkdir -p seekdb
docker run -d -p 2881:2881 -v $PWD/seekdb:/var/lib/oceanbase --name seekdb oceanbase/seekdb
Connect to a seekdb instance
You can use the OBClient or MySQL client on the host to connect to the seekdb instance.
[admin@test001 ~]$ mysql -uroot -h127.0.0.1 -P2881 -p
If the password is not configured through environment variables when starting the seekdb instance, users created in the instance use empty passwords by default.
After a successful connection, the terminal displays the following content:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221628904
Server version: 5.7.25 OceanBase 4.3.5.3 seekdb (r1.0.0.0) (Built 102025110516-83ac0ad994286047a3e713e82e9541383f6df531 Nov 5 2025)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
Access the obshell dashboard
The container also starts obshell, which provides a user-friendly web interface. If you want to access the obshell dashboard, you can also map the obshell dashboard port.
# 2886 is the port for the obshell dashboard
docker run -d -p 2881:2881 -p 2886:2886 oceanbase/seekdb
You can access http://${server_ip}:2886 through a browser. The login password is the same as the root user password. If ROOT_PASSWORD is not set, leave the password field empty.