Self-Hosting
Prerequisites
- Node.js 18+
- PostgreSQL 14+
- pnpm
- A GitHub OAuth app (for authentication)
Clone and Setup
make dev-setup installs dependencies and runs database migrations.
Database Setup
Create a PostgreSQL database and run migrations:
API Server
Environment Variables
Create packages/api/.env from the example:
Required variables:
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
JWT_SECRET | Secret for signing JWT tokens — use a long random string |
GITHUB_CLIENT_ID | GitHub OAuth app client ID |
GITHUB_CLIENT_SECRET | GitHub OAuth app client secret |
GITHUB_CALLBACK_URL | OAuth callback URL (e.g. https://api.example.com/auth/github/callback) |
PORT | Port to listen on (default: 3001) |
Optional variables:
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | AWS credentials for Secrets Manager backend |
AWS_SECRET_ACCESS_KEY | AWS credentials for Secrets Manager backend |
AWS_REGION | Default AWS region |
Start the API Server
For production, use a process manager:
Web Dashboard
Environment Variables
Create packages/web/.env.local from the example:
| Variable | Description |
|---|---|
NEXT_PUBLIC_API_URL | URL of the ev API server (e.g. https://api.example.com) |
NEXTAUTH_SECRET | Secret for NextAuth.js sessions |
NEXTAUTH_URL | Public URL of the web dashboard (e.g. https://ev.example.com) |
GITHUB_CLIENT_ID | GitHub OAuth app client ID |
GITHUB_CLIENT_SECRET | GitHub OAuth app client secret |
Start the Web Dashboard
GitHub OAuth App Setup
- Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Set Homepage URL to your web dashboard URL (e.g.
https://ev.example.com) - Set Authorization callback URL to
https://ev.example.com/api/auth/callback/github - Copy the Client ID and generate a Client Secret
- Set these in both
packages/api/.envandpackages/web/.env.local
Docker Example
A minimal Docker Compose setup for the API server:
Client Configuration
Point the ev CLI at your self-hosted instance:
Or set the environment variable: