Documentation Index
Fetch the complete documentation index at: https://docs.cubby.pro/llms.txt
Use this file to discover all available pages before exploring further.
cubby dev
Start a local development environment. This gives your app a Cubby-shaped runtime locally: hot reload, local secrets, and aDATABASE_URL that matches the database path you chose.
cubby dev runs your app in a container and requires Docker — it is the right tool
when you want a local Neon Postgres database (it runs a local postgres:17-alpine).
For the default SQLite template (or a no-database app), you do not need cubby dev or
Docker at all: just run npm run dev. Cubby runs prisma db push for you on deploy, so no
local database is required for frontend work. See cubby init.Usage
Flags
| Flag | Description | Default |
|---|---|---|
--reset | Reset database (deletes all local data) | false |
--prod-mode | Simulate production environment (NODE_ENV=production) | false |
Examples
What Happens
- Validation - Checks for
cubby.yamland Docker - Port detection - Finds available ports (default: 3000 for app)
- Secret injection - Loads local secrets (set via
cubby secrets set) - Compose generation - Creates
docker-compose.dev.yml - Container build - Builds your app container
- Database setup - Prepares the local database environment for your selected template
- Schema sync - Runs
prisma db pushwhen Prisma is present - Log streaming - Shows app and database logs when available
Output
How It Differs from npm run dev
| Feature | cubby dev | npm run dev |
|---|---|---|
| Database | Cubby-shaped local DATABASE_URL | Manual setup required |
| Secrets | Injected from cubby secrets | Manual .env file |
| Environment | Production-like container | Node.js directly |
| Schema sync | Automatic | Manual prisma db push |
| Cleanup | Automatic on Ctrl+C | None |
Database Persistence
Data persists betweencubby dev sessions in the local database storage for your selected template.
To start fresh:
Local Secrets
Secrets set withcubby secrets set are automatically injected:
process.env.OPENAI_API_KEY in your app.
Port Conflicts
If the default app port is in use,cubby dev automatically finds an alternative:
Stopping Development
PressCtrl+C to stop. This:
- Kills log streaming
- Stops containers
- Cleans up
docker-compose.dev.yml
Requirements
- Docker must be running (required for
cubby dev; not required fornpm run devon a SQLite or no-database app) - Project must have
cubby.yaml(runcubby initfirst)
Troubleshooting
”Docker is not running”
Start Docker Desktop and try again.”Not a Cubby app directory”
Runcubby init first, or cd to a directory with cubby.yaml.
”Database failed to become healthy”
This applies to the Neon/Postgres local container. It may be slow to start — try:cubby dev at all — run npm run dev instead (no
Docker, no database container).
Schema Sync Warning
Ifprisma db push fails, you’ll see a warning but dev continues:
npx prisma db push manually to see the full error.
Related Commands
cubby init- Create a new appcubby secrets- Manage local secretscubby deploy- Deploy to production