Local Setup
Set up Enclavr for local development.
Prerequisites
- Go 1.25+ - For the server
- Bun - For the frontend
- Docker & Docker Compose - For infrastructure
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:
- Create a Neon project at neon.tech
- Get your connection string from the Neon dashboard
- Copy
server/.env.exampletoserver/.env - Set
NEON_CONNECTION_STRINGwith your connection string - Run
docker compose up -d redisin 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:
- PostgreSQL 18 on port 5432
- Redis 8 on port 6379
- Go server on port 8080
- Next.js frontend on port 3000
- Coturn TURN server on port 3478
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
- Open http://localhost:3000 in your browser
- Register a new account
- Create a room
- 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