Development Setup
Complete guide to setting up the Emberly development environment locally. Prerequisites, configuration, database setup, and running the dev server.
This guide covers setting up Emberly for local development. Follow these steps to get the entire stack running on your machine.
Prerequisites
System Requirements
- OS: Linux, macOS, or Windows (with WSL2 recommended)
- RAM: 8 GB minimum (16 GB recommended)
- Disk: 20 GB free space
Required Software
Ensure you have installed:
-
Node.js 18+ (download)
-
Bun (recommended package manager) or npm/yarn
-
PostgreSQL 14+ (download)
-
Git
-
Docker (optional but recommended for services)
Repository Structure
The Emberly repo is a single Next.js application:
The documentation site (docs.embrly.ca), Flicker desktop app, and premid integration are separate repositories — not subdirectories of the main app.
Step 1: Clone Repository
Step 2: Install Dependencies
Using bun (recommended):
Or using npm:
Installation takes ~5-10 minutes on first run.
Step 3: Set Up Services
PostgreSQL
Option A: Local PostgreSQL
macOS (with Homebrew):
Linux (Ubuntu/Debian):
Windows (WSL2):
Create development database:
Or via psql:
Option B: Docker (Recommended)
Use Docker Compose for a containerized PostgreSQL:
Create docker-compose.yml in project root:
Start PostgreSQL:
Stop PostgreSQL:
Redis
Redis is required for chunked upload sessions and caching. If unavailable, the app falls back to filesystem storage for uploads.
Option A: Local Redis
Option B: Docker
Step 4: Configuration
Copy Environment Template
Configure .env.local
Edit .env.local with your values:
Generate NEXTAUTH_SECRET
Generate a secure random secret:
Using OpenSSL:
Using Node.js:
Paste the output into NEXTAUTH_SECRET.
Environment Variables
Edit .env.local with your values:
Admin UI configuration
Many integrations (Stripe, Cloudflare, GitHub, Discord, Kener, and email) can also be configured after first run via the Admin Panel → Settings UI. Values set there are stored in the database and override environment variables. You only need .env values for the initial setup.
Project Structure
Architecture
File uploads:
Chunked uploads:
Database Management
First Run: Setup Wizard
On the first server start with an empty database, Emberly redirects to /setup — a guided wizard that:
- Creates the initial admin account (username, email, password)
- Configures storage (local filesystem or S3-compatible)
- Configures registration settings (open or invite-only)
Complete the wizard before using the application. After setup, seed the subscription plans:
This creates the Spark/Glow/Flare/Blaze/Inferno/Ember plan records in the database.
Running in Production
For production deployments, consider:
- Vercel or Railway for the Next.js app
- Neon, Supabase, or Railway PostgreSQL for the database
- Tigris, Cloudflare R2, or AWS S3 for file storage
Flicker Desktop App
Flicker is a separate repository — EmberlyOSS/Flicker. Clone it independently and follow its own setup instructions. See the Flicker guide for details.