Development Setup
Get the Emberly development stack running locally from clone to first request.
This guide walks through setting up Emberly for local development. By the end you will have the full stack running: database, cache, file storage, and the Next.js dev server.
Prerequisites
System requirements:
- OS: Linux, macOS, or Windows (WSL2 recommended on Windows)
- RAM: 8 GB minimum (16 GB recommended)
- Disk: 20 GB free
Required software:
| Tool | Version | Check |
|---|---|---|
| Bun | Latest | bun --version |
| Node.js | 18+ | node --version |
| PostgreSQL | 14+ | psql --version |
| Redis | 7+ | redis-cli --version |
| Git | Any | git --version |
| Docker | Optional | docker --version |
Step 1: Clone and Install
Installation takes a few minutes on first run while Bun resolves the lockfile.
Step 2: Set Up Services
You need PostgreSQL and Redis running before the app starts. Docker Compose is the fastest path.
Option A: Docker Compose (Recommended)
Create a docker-compose.yml in the project root:
Option B: Local Services
PostgreSQL:
Redis:
Step 3: Configure Environment
Copy the template to .env:
Edit .env with your values:
Generate a NEXTAUTH_SECRET:
OAuth apps
For local development, create GitHub and Discord OAuth apps pointing to http://localhost:3000/api/auth/callback/github and /discord respectively. Both are optional — you can log in with email/password if you skip them.
Storage and integrations
S3 storage, Stripe, Resend email, and Cloudflare are configured after first run via Admin Panel → Settings → Integrations. They are stored in the database, not in .env.
Step 4: Database Setup
Step 5: Start the Dev Server
Open http://localhost:3000. On first load with an empty database, you are redirected to /setup — a one-time wizard that creates the admin account and configures initial settings. Complete this before anything else.
Project Structure
Database Management
After every edit to prisma/schema.prisma, run bun run db:generate.
Never use db:push in staging or production. Always use db:deploy.
Common Commands
Architecture Reference
Chunked upload flow:
Event Worker
The event worker processes background jobs (OCR, email, bucket provisioning). In development it runs in-process when EMBERLY_RUN_EVENT_WORKER=true is set in .env. It is off by default so you can start the app without a Redis connection.
Flicker Desktop App
Flicker is a separate repository — EmberlyOSS/Flicker. Clone and set it up independently. See the Flicker integration guide for details.