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:| Database | Default version | Default port |
|---|---|---|
| PostgreSQL | 18 | 5432 |
| MySQL | latest | 3306 |
| Redis | latest | 6379 |
Key features
- Interactive and flag-based usage — run
mkdb startto 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
--ttlor extend it later withmkdb extend - Encrypted credentials — passwords are stored using AES-256-GCM; retrieve or copy your connection string at any time with
mkdb creds getormkdb 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_URLin environment variable format after everystart - User management — create and delete additional database users with
mkdb user createandmkdb user delete
Container lifecycle
mkdb containers follow a straightforward lifecycle:- Start —
mkdb startcreates the container and its volume, then prints the connection string - Stop / restart —
mkdb stopstops the container while preserving its data;mkdb restartbrings it back up - Remove —
mkdb removepermanently deletes the container and its volume - 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.