/Resources
/Introduction
/How to Contribute
/Local Development Setup

Local Development Setup

Step-by-step guide to clone, install, and run Reloop services locally.

Welcome to the local development setup guide for Reloop. Reloop is a high-performance, type-safe email and campaign automation platform designed as a modern monorepo.

This document provides a clear, sequential path for both developers and automated agents to set up and run all services in a local environment.


Prerequisites

Before starting, ensure that you have the following installed on your machine:

  • Bun: The fast all-in-one JavaScript runtime (v1.3.0+) → Install Bun
  • Docker & Docker Compose: To run PostgreSQL, Redis, ClickHouse, etc. → Install Docker Desktop
  • Git: For cloning the repository

Interactive Walkthrough

Follow these steps sequentially to set up and run the Reloop monorepo in your local environment.

Strict Sequential Order Required

Please perform all steps in the exact order listed below to prevent database connectivity errors and routing issues.

1

Clone and Install Dependencies

First, verify that your local environment has Bun v1.3.0+ installed:

bun --version

Next, clone the repository and install all node modules from the root directory:

git clone git@github.com:reloop-labs/reloop.git
cd reloop
bun install
2

Configure Local Domain (Hosts File)

Reloop uses a unified local domain (local.reloop.sh) and a Caddy reverse proxy to manage session cookies and authentication seamlessly across all microservices. To enable this, you must map local.reloop.sh to your loopback address (127.0.0.1).

echo "127.0.0.1 local.reloop.sh" | sudo tee -a /etc/hosts
Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value "127.0.0.1`tlocal.reloop.sh"
System Privileges Required

Modifying your hosts file requires administrator or root privileges. You may be prompted to input your system password.

3

Start Docker Infrastructure

Reloop relies on several high-performance backing services. Ensure Docker is running on your machine, then spin up the complete infrastructure suite:

bun docker:up

This boots the following services in the background:

  • PostgreSQL (5432): Core database for transactional data and auth.
  • Redis (6379): Cache store, background workers, and session management.
  • ClickHouse (8123): High-speed analytics and logs database.
  • Caddy (80 / 443): Auto-SSL gateway and reverse-proxy routing.
  • Grafana & Loki (3000 / 3100): Log aggregation and service dashboards.
Troubleshoot Port Conflicts

Caddy, Postgres, and Redis bind to their standard ports on your host. If you have existing local instances of PostgreSQL (5432), Redis (6379), or web servers (Nginx/Apache on 80 or 443) running directly on your host machine, you must stop them before starting the Docker container suite.

4

Initialize the Database

Before running migrations, wait 5–10 seconds after starting Docker to ensure PostgreSQL is fully healthy and accepting connections.

Then, apply the database schema (via Drizzle ORM) and seed the initial/default workspace metadata directly from the root directory:

# Push the schema changes directly to your local database
bun db:push

# Populate the database with default workspace and seed data
bun db:seed
Explore Schema via Drizzle Studio

You can inspect your local database tables visually at any time:

bun db:studio
5

Configure Environment Variables

Reloop microservices seek .env files within their respective subdirectories. We provide two ways to configure them:

# Automatically generates all service .env files from their .env.dev templates in 1 click
bun env:setup

If you prefer to copy them manually, duplicate the .env.dev templates to .env in the target directories. For example, for the Auth Service:

cp apps/backend/auth/.env.dev apps/backend/auth/.env
6

Start Reloop Services

Run the development servers concurrently using Turborepo from the root directory:

bun dev

If you only wish to work on frontend or backend subsystems, you can run them separately:

bun frontend:dev
bun backend:dev

Once running, your entire secure Reloop portal is unified and accessible at https://local.reloop.sh!


Service URLs and Ports Reference

Once your development servers are running, they are accessible through the unified gateway domain or via their direct localhost ports.

Thanks to the Caddy reverse proxy, you can access the entire unified platform securely under a single local domain (https://local.reloop.sh). This is the recommended entrypoint as it manages cookie sharing and CORS seamlessly:

Route PathDestinationTarget PortDescription
https://local.reloop.sh/Web App3000Main public marketing pages & landing site
https://local.reloop.sh/dashboardUser Dashboard3001Core workspace, campaigns, and user dashboard app
https://local.reloop.sh/docsPublic Docs3003This developer/public documentation portal
https://local.reloop.sh/api/authAuth API8000User auth, sessions, Better Auth handler
https://local.reloop.sh/api/...Microservice APIs8011 - 8023Dynamic routes to individual backend APIs

Direct Frontend Applications

If you need to access frontend applications directly without the Caddy proxy:

ApplicationDirect URLPortDescription
Web Apphttp://localhost:30003000Marketing website and public content
User Dashboardhttp://localhost:30013001Main client app (workspaces, lists, campaigns)
Public Docshttp://localhost:30033003This developer/public documentation portal

Direct Backend API Services

Backend microservices receive API requests from the frontend via the Caddy proxy at https://local.reloop.sh/api/.... However, you can also query them directly at their raw localhost ports:

Service NameCaddy RouteRaw PortDescription
Auth API/api/auth8000Better Auth handlers and user management
Domain API/api/domain8011Custom domain delegation & DKIM verification
API Key API/api/api-key8012External and internal API key provisioning
Webhook API/api/webhook8013Webhook ingress and dispatching handlers
Contacts API/api/contacts8014Recipient groups, segments, and contact listings
Mailing API/api/mail8015Campaign engine, SMTP queues, and sending pipeline
Logs API/api/logs8016Event logger and ClickHouse query service
Workflow API/api/workflow8017Automation workflows and state engines
Upload API/api/upload8018File upload storage manager and CDN endpoints
Template API/api/template8019Visual email builder & templates repository
Kumomta API/api/kumomta8021Kumomta mail server synchronization hook
Email API/api/email8022Direct transactional email handler
Billing API/api/billing8023Stripe subscriptions and billing integration

Backing Infrastructure Services

These supporting systems are hosted inside Docker containers and run as your backend services' dependencies:

ServicePortDescription
PostgreSQL5432Primary relational database
Redis6379Cache and BullMQ background task queue
ClickHouse8123High-volume analytical tracking database
NATS4222Core messaging bus / pub-sub broker
Loki3100Log aggregation engine
Grafana3000 (Direct)Infrastructure metrics dashboards

Quick Developer Cheat Sheet

Keep these core monorepo commands handy for routine tasks:

CommandActionScope
bun run checkRun code quality checks, lints, and format checksFull Monorepo
bun env:setupAutomatically populate all backend microservice .env filesEnvironments
bun db:pushSynchronize current schema changes to PostgreSQLDatabase
bun db:seedRe-seed the local database with default dataDatabase
bun docker:downStop and tear down all docker containersInfrastructure
bun run --filter=<package-name> <script>Run a package script specificallyTarget Package

Next Steps

Now that your base local environment is running, explore the specialized setup instructions: