Local Setup

Set up Enclavr for local development.

Prerequisites

Clone Repository

# Clone with submodules
git clone --recurse-submodules https://github.com/enclavr/enclavr.git
cd enclavr

Start Infrastructure

You can run infrastructure locally using Docker Compose, or use Neon (cloud PostgreSQL) for the database.

Option 1: Neon PostgreSQL (Default)

Neon is the default database - sign up at neon.tech for a free account:

  1. Create a Neon project at neon.tech
  2. Get your connection string from the Neon dashboard
  3. Copy server/.env.example to server/.env
  4. Set NEON_CONNECTION_STRING with your connection string
  5. Run docker compose up -d redis in infra folder for Redis only
# In server/.env
NEON_CONNECTION_STRING=postgres://user:password@host.neon.tech/neondb?sslmode=require

Option 2: Docker Compose (Local)

# Clone with submodules
git clone --recurse-submodules https://github.com/enclavr/enclavr.git
cd enclavr/infra

# Copy environment file
cp .env.example .env

# Start services
docker compose up -d

# Verify services are running
docker compose ps

This starts:

Note: PostgreSQL 18+ changed the data volume path. If using self-hosted PostgreSQL 18, set PGDATA: /var/lib/postgresql/18/docker in your docker-compose.yml.

Start Server

cd server

# Run the server
go run ./cmd/server

The server runs on http://localhost:8080

Start Frontend

cd frontend

# Install dependencies
bun install

# Start development server
bun run dev

The frontend runs on http://localhost:3000

Verify Setup

  1. Open http://localhost:3000 in your browser
  2. Register a new account
  3. Create a room
  4. Test chat and voice functionality

Troubleshooting

Port Already in Use

# Find process using port
lsof -i :8080

# Kill process
kill <PID>

Database Connection Failed

# Check PostgreSQL
docker compose logs postgres

# Restart PostgreSQL
docker compose restart postgres

Build Errors

# Clear and reinstall dependencies
cd frontend && rm -rf node_modules bun.lock && bun install