Skip to main content
This quickstart walks you through creating a local database container, retrieving its connection string, and verifying that the database is ready to accept connections. By the end, you will have a running PostgreSQL, MySQL, or Redis container and a DB_URL you can drop straight into your project.
1

Create your first database

Run mkdb start to launch the interactive setup. mkdb prompts you for the database type, a name, authentication preference, and volume option:
Follow the prompts:
After mkdb pulls the image and starts the container, it prints your connection string and expiry time:
If you already know what you want, skip the prompts with flags:
2

Save your connection string

Retrieve your connection string at any time with mkdb creds get:
Output:
Append it directly to your .env file:
Or copy it to your clipboard:
3

Verify the connection

Confirm the database is reachable by running a test query:
You can also use the ping alias:
mkdb runs a lightweight query against the container and displays the result. For PostgreSQL it executes SELECT 1 as status, current_user, current_database();, and for Redis it sends a PING command.
4

List your databases

See all containers mkdb is tracking:
Or use the shorter alias:
The output is a formatted table with the following columns:Filter by type or status when you have many containers:
5

Stop or remove the database

Stop the container to pause it and preserve all data on disk:
You can restart it later with mkdb restart --name mydb.Remove the container when you no longer need it. This permanently deletes the container and its volume:
Containers expire after 2 hours by default. When a container expires, mkdb stops and removes it along with its volume. To set a longer lifetime, pass --ttl when you create the database — for example, mkdb start --db postgres --name mydb --ttl 48 keeps the container alive for 48 hours. You can also extend an existing container’s lifetime with mkdb extend --name mydb --hours 24.

Next steps

All start flags

Explore every option available when creating a database container.

Manage TTL

Configure default lifetimes and extend containers before they expire.

Volume options

Choose between named volumes, custom paths, or no persistence.

Credentials

Retrieve, copy, and rotate connection strings and passwords.