Skip to main content

Documentation Index

Fetch the complete documentation index at: https://test.pzona.fun/llms.txt

Use this file to discover all available pages before exploring further.

mkdb is a CLI tool that wraps Docker to create and manage local database containers for development. This page covers what mkdb does, the databases it supports, its key capabilities, and how containers move through their lifecycle.

What mkdb does

Setting up a local database for development typically means installing a database server, configuring it, and remembering to clean it up when you’re done. mkdb replaces that process with a single command. It starts a Docker container with sensible defaults, generates encrypted credentials, and removes the container automatically when it expires — so you can focus on building instead of managing infrastructure.

Supported databases

mkdb supports three database types, each with a default version and port:
DatabaseDefault versionDefault port
PostgreSQL185432
MySQLlatest3306
Redislatest6379
If the default port is already in use, mkdb automatically selects the next available port. You can also override the version and port with flags when creating a container.

Key features

  • Interactive and flag-based usage — run mkdb start to follow prompts, or pass --db, --name, and other flags to skip them entirely and script your setup
  • Auto-TTL cleanup — containers expire after 2 hours by default; adjust the TTL at creation time with --ttl or extend it later with mkdb extend
  • Encrypted credentials — passwords are stored using AES-256-GCM; retrieve or copy your connection string at any time with mkdb creds get or mkdb creds copy
  • Volume management — choose no persistence, a named volume stored in ~/.local/share/mkdb/volumes/, or a custom bind-mount path
  • Connection string generation — mkdb prints a ready-to-use DB_URL in environment variable format after every start
  • User management — create and delete additional database users with mkdb user create and mkdb user delete

Container lifecycle

mkdb containers follow a straightforward lifecycle:
  1. Startmkdb start creates the container and its volume, then prints the connection string
  2. Stop / restartmkdb stop stops the container while preserving its data; mkdb restart brings it back up
  3. Removemkdb remove permanently deletes the container and its volume
  4. Automatic cleanup — when a container’s TTL expires, mkdb removes it and its volume the next time any mkdb command runs; you can also trigger this manually with mkdb cleanup

Installation

Install mkdb on macOS or Linux using a pre-built binary, Go install, or build from source.

Quick start

Create your first database container and get a connection string in three steps.