How it works

Ephemeral databases in three steps

TrashDB provisions isolated database containers on demand. Each container is ephemeral, runs in its own Docker sandbox, and self-destructs when its TTL expires.

01

Authenticate with an API key

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 })
02

Spin up a container

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
}
03

Connect, use, forget

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

How TrashDB works internally

Docker isolation

Every database runs in its own Docker container with an isolated filesystem, network stack, and resource limits. No two tenants share a process.

TTL enforcement

A background service checks every 60 seconds for expired containers. When a TTL expires, the container is stopped and removed. No zombie processes.

Auto-cleanup

On startup, TrashDB reconciles its database with the actual Docker state. Orphaned entries are cleaned up, and past-expiry containers are killed immediately.

Port management

Each container binds to a random host port, avoiding conflicts. Connection strings include the assigned port so you can connect immediately.

TypeScript SDK

The @trashdb/ts-client package wraps the REST API with typed methods, retry logic with exponential backoff, and full TypeScript support.

API key auth

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

Supported databases

EngineTypeInternal portImageMax TTL
ChromaDBVector8000chromadb/chroma:latest24h
QdrantVector6333qdrant/qdrant:latest24h
RedisKV6379redis:7-alpine24h
PostgreSQLRelational5432postgres:15-alpine24h
MongoDBDocument27017mongo:latest24h
SupabaseRelational5432supabase/postgres:17.6.1.13824h

API

REST API overview

POST/api/v1/containers
GET/api/v1/containers
DELETE/api/v1/containers/{id}
GET/api/v1/containers/{id}/logs
GET/api/v1/engines
GET/api/v1/me
GET/api/v1/me/usage

Ready to trash some databases?

100 hours of free compute per month. No credit card required.

Create your account