Self-host TiDB with Levelrail

A MySQL compatible distributed SQL database, run here as a single node on local storage for development and testing. Apache-2.0 licensed. The root user has no password, so keep it private.

  • Authorpingcap
  • LicenceApache-2.0
  • Memory1 GiB
  • Services1

How to self-host TiDB

  1. Pull the images

    One image is pulled on your server.

    Show images
    • pingcap/tidb:v7.5.8
  2. Create the app

    One service starts in a single Compose app, on ports 4000, 10080.

  3. Fill in the secrets

    You do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Connect with any MySQL client on port 4000 as root with an empty password, then create a user and password.

TiDB requirements

Memory
About 1 GiB
Architectures
amd64 unknown, arm64 unknown
Ports
4000, 10080
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
Apache-2.0, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then TiDB. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the TiDB docs page.

Deploy TiDB your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy TiDB from the CLI

levelrail-cli templates deploy tidb --name my-tidb

Deploy TiDB with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/tidb/deploy

TiDB configuration

TiDB services

ServiceImagePortsVolumes
tidb pingcap/tidb:v7.5.8 4000, 10080 none

TiDB environment variables

The catalog lists no environment variables for this template.

Ports and volumes

Ports
4000, 10080
Volumes
none

TiDB FAQ

How much memory does TiDB need?

The catalog lists about 1 GiB of memory for TiDB.

Does TiDB run on arm64?

For TiDB, arm64 support is not confirmed; amd64 is unknown.

What licence is TiDB under?

TiDB is licensed under Apache-2.0, which is permissive, with few conditions on reuse.

Does TiDB need configuration before it starts?

No. The template fills in its own defaults.

Which ports does TiDB use?

TiDB listens on ports 4000 and 10080 inside the stack.

Can I deploy TiDB on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for TiDB, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image pingcap/tidb:v7.5.8 is what you deploy there.

levelrail-cli templates deploy tidb --name my-tidb