Self-host CockroachDB with Levelrail

A distributed SQL database that speaks the Postgres wire protocol, run as one insecure node for development and small workloads. The SQL port is private, the admin console is the web page. Source available license.

  • Authorcockroachdb
  • LicenceLicenseRef-CockroachDB-Software-License
  • Memory1 GiB
  • Services1

How to self-host CockroachDB

  1. Pull the images

    One image is pulled on your server.

    Show images
    • cockroachdb/cockroach:v24.3.1
  2. Create the app

    One service starts in a single Compose app, with 1 named volume mount for your data, on ports 8080, 26257.

  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

  • Open the admin console, and connect clients from this project to cockroachdb:26257 as root with no password.

CockroachDB requirements

Memory
About 1 GiB
Architectures
amd64 unknown, arm64 unknown
Ports
8080, 26257
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
  • 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 CockroachDB. 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 CockroachDB docs page.

Deploy CockroachDB your way

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

Deploy CockroachDB from the CLI

levelrail-cli templates deploy cockroachdb --name my-cockroachdb

Deploy CockroachDB 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/cockroachdb/deploy

CockroachDB configuration

CockroachDB services

ServiceImagePortsVolumes
cockroachdb cockroachdb/cockroach:v24.3.1 8080, 26257 cockroach_data -> /cockroach/cockroach-data

CockroachDB environment variables

The catalog lists no environment variables for this template.

Ports and volumes

Ports
8080, 26257
Volumes
1 named mount: cockroach_data -> /cockroach/cockroach-data

CockroachDB FAQ

How much memory does CockroachDB need?

The catalog lists about 1 GiB of memory for CockroachDB.

Does CockroachDB run on arm64?

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

What licence is CockroachDB under?

CockroachDB is licensed under LicenseRef-CockroachDB-Software-License, which is source-available, so read the terms before commercial use.

Does CockroachDB need configuration before it starts?

No. The template fills in its own defaults.

Which ports does CockroachDB use?

CockroachDB listens on ports 8080 and 26257 inside the stack.

Where does CockroachDB keep its data?

In a named volume: cockroach_data mounted at /cockroach/cockroach-data.

Can I deploy CockroachDB 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 CockroachDB, 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 cockroachdb/cockroach:v24.3.1 is what you deploy there.

levelrail-cli templates deploy cockroachdb --name my-cockroachdb