How it works
TrashDB provisions isolated database containers on demand. Each container is ephemeral, runs in its own Docker sandbox, and self-destructs when its TTL expires.
Sign up, open your Dashboard and generate an API key. The key is shown once — store it securely. You can regenerate it at any time from the dashboard.
All requests to the TrashDB API are authenticated via the X-Api-Key header or an Authorization: Bearer token from your Supabase session.
# Set your API key
export TRASHDB_KEY=tdb_live_abc123def456
# Or use the TypeScript SDK
import { TrashDB } from "@trashdb/ts-client"
const db = new TrashDB({ apiKey: process.env.TRASHDB_KEY })One POST request with the engine name and a TTL (time-to-live) in minutes. TrashDB provisions the container, assigns a random public port, and returns a connection string.
You get a fully isolated database — no shared state, no noisy neighbours, no configuration needed.
TTL can be between 1 and 1440 minutes (24 hours). The container auto-destroys after that.
curl -X POST https://api.trashdb.dev/api/v1/containers \
-H "X-Api-Key: $TRASHDB_KEY" \
-H "Content-Type: application/json" \
-d '{
"engine": "chromadb",
"ttlMinutes": 60,
"name": "my-test-db"
}'
# Response:
{
"id": "a1b2c3d4e5f6",
"engine": "chromadb",
"port": 32768,
"connectionString": "http://localhost:32768",
"createdAt": "2026-06-24T12:00:00Z",
"ttlMinutes": 60
}Use the returned connection string to connect from your application or CLI. The container behaves exactly like a self-hosted instance — all features of the engine are available.
When the TTL hits zero, TrashDB stops and removes the container automatically. No cleanup scripts, no stale instances, no forgotten VPS bills.
You can also destroy a container early via the Dashboard or the API.
# ChromaDB — standard HTTP client
curl -X POST http://host:32768/api/v1/collections \
-H "Content-Type: application/json" \
-d '{"name": "my-collection"}'
# PostgreSQL — standard psql
psql -h host -p 32768 -U postgres -d postgres
# Redis — standard redis-cli
redis-cli -h host -p 32768 -a <password>
# Or destroy early:
curl -X DELETE https://api.trashdb.dev/api/v1/containers/a1b2c3d4e5f6 \
-H "X-Api-Key: $TRASHDB_KEY"Under the hood
Every database runs in its own Docker container with an isolated filesystem, network stack, and resource limits. No two tenants share a process.
A background service checks every 60 seconds for expired containers. When a TTL expires, the container is stopped and removed. No zombie processes.
On startup, TrashDB reconciles its database with the actual Docker state. Orphaned entries are cleaned up, and past-expiry containers are killed immediately.
Each container binds to a random host port, avoiding conflicts. Connection strings include the assigned port so you can connect immediately.
The @trashdb/ts-client package wraps the REST API with typed methods, retry logic with exponential backoff, and full TypeScript support.
Requests can be authenticated via API key (suitable for CI/CD) or Supabase Bearer token (for the dashboard). API keys are hashed with SHA-256 at rest.
Engines
| Engine | Type | Internal port | Image | Max TTL |
|---|---|---|---|---|
| ChromaDB | Vector | 8000 | chromadb/chroma:latest | 24h |
| Qdrant | Vector | 6333 | qdrant/qdrant:latest | 24h |
| Redis | KV | 6379 | redis:7-alpine | 24h |
| PostgreSQL | Relational | 5432 | postgres:15-alpine | 24h |
| MongoDB | Document | 27017 | mongo:latest | 24h |
| Supabase | Relational | 5432 | supabase/postgres:17.6.1.138 | 24h |
API
/api/v1/containersCreate a new container/api/v1/containersList your running containers/api/v1/containers/{id}Destroy a container immediately/api/v1/containers/{id}/logsFetch stdout/stderr logs/api/v1/enginesList supported engines and their max TTL/api/v1/meGet your profile and API key status/api/v1/me/usageCheck your current monthly usage100 hours of free compute per month. No credit card required.
Create your account