OwnPilot Setup Guide

May 7, 2026 ยท View on GitHub

This guide covers setting up OwnPilot from scratch, including prerequisites, automated setup, and manual configuration.

Prerequisites

Required Software

SoftwareVersionPurpose
Node.js22+Runtime
pnpm10+Package manager
DockerLatestPostgreSQL database
GitLatestVersion control

OS-Specific Setup

Windows

  1. Install Node.js 22+: https://nodejs.org/
  2. Install Docker Desktop: https://www.docker.com/products/docker-desktop/
  3. Install pnpm: npm install -g pnpm

macOS

# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js 22
brew install node@22

# Install Docker Desktop
brew install --cask docker

# Install pnpm
npm install -g pnpm

Linux (Ubuntu/Debian)

# Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
sudo apt-get install -y nodejs

# Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

# pnpm
npm install -g pnpm

Quick Start

Linux/macOS

git clone https://github.com/ownpilot/ownpilot.git
cd ownpilot
./setup.sh

Windows PowerShell

git clone https://github.com/ownpilot/ownpilot.git
cd ownpilot
.\setup.ps1

The interactive wizard will guide you through the complete setup.

Setup Modes

ModeDescription
Full (default)Complete setup: Docker, dependencies, database, build, dev server
MinimalOnly install dependencies and create .env
DockerOnlyOnly Docker + PostgreSQL database
SkipInstallSkip pnpm install (for already installed deps)

Usage Examples

# Linux/macOS
./scripts/setup.sh --minimal          # Skip Docker
./scripts/setup.sh --docker-only      # Only database
./scripts/setup.sh --skip-install     # Already have deps

# Windows PowerShell
.\scripts\setup.ps1 -Mode Minimal
.\scripts\setup.ps1 -Mode DockerOnly
.\scripts\setup.ps1 -Mode SkipInstall

Manual Setup

If you prefer to set up manually or need more control:

1. Clone Repository

git clone https://github.com/ownpilot/ownpilot.git
cd ownpilot

2. Install Dependencies

pnpm install

3. Configure Environment

# Copy example environment file
cp .env.example .env

Edit .env with your settings. The defaults work with Docker Compose PostgreSQL:

# Server
PORT=8080
UI_PORT=8199
HOST=127.0.0.1
NODE_ENV=development

# Database (Docker Compose defaults)
POSTGRES_HOST=localhost
POSTGRES_PORT=25432
POSTGRES_USER=ownpilot
POSTGRES_PASSWORD=ownpilot_secret
POSTGRES_DB=ownpilot

# Authentication
AUTH_TYPE=none

# Logging
LOG_LEVEL=info

4. Start PostgreSQL

docker compose --profile postgres up -d

Option B: Manual Docker

docker run -d \
  --name ownpilot-db \
  --restart unless-stopped \
  -e POSTGRES_USER=ownpilot \
  -e POSTGRES_PASSWORD=ownpilot_secret \
  -e POSTGRES_DB=ownpilot \
  -p 25432:5432 \
  -v ownpilot-postgres-data:/var/lib/postgresql/data \
  pgvector/pgvector:pg16

Wait for PostgreSQL to be ready (usually 5-10 seconds):

docker exec ownpilot-db pg_isready -U ownpilot

5. Initialize Database

cd packages/gateway

# Run initial schema (if exists)
psql -h localhost -p 25432 -U ownpilot -d ownpilot -f src/db/migrations/postgres/001_initial_schema.sql

# Or use seed script
pnpm run seed

6. Build Project

pnpm build

7. Start Development Server

pnpm dev

Starting OwnPilot

Development Mode

# Linux/macOS
./start.sh

# Windows PowerShell
.\start.ps1

Start Options

OptionDescription
--devDevelopment mode with hot reload (default)
--prodProduction mode (build & serve)
--dockerStart with Docker Compose
--no-uiGateway only, without UI
--port PORTGateway API port (default: 8080)
--ui-port PORTUI dev server port (default: 8199)

Manual Start

# Install dependencies (if not done)
pnpm install

# Start development servers
pnpm dev

Services & URLs

After starting, these services are available:

ServiceURLDescription
Gateway APIhttp://localhost:8080REST API server
UIhttp://localhost:8199Web interface
PostgreSQLlocalhost:25432Database

Configuration

AI Providers

AI provider API keys are configured via:

  1. Web UI: Config Center (Settings page)
  2. CLI: ownpilot config set <provider>-api-key <key>

Supported providers:

  • OpenAI (OPENAI_API_KEY)
  • Anthropic (ANTHROPIC_API_KEY)
  • Google (GOOGLE_API_KEY)
  • Azure OpenAI (AZURE_OPENAI_*)
  • Ollama (OLLAMA_BASE_URL)
  • Custom LLM endpoints

Environment Variables

VariableDefaultDescription
PORT8080Gateway API port
UI_PORT8199UI dev server port
POSTGRES_HOSTlocalhostDatabase host
POSTGRES_PORT25432Database port
NODE_ENVdevelopmentEnvironment
LOG_LEVELinfoLogging level

Docker Compose Profiles

ProfileServicesUsage
postgresPostgreSQLDatabase only
(default)AllFull stack
# Database only
docker compose --profile postgres up -d

# Full stack
docker compose up -d

Troubleshooting

Port Already in Use

# Find process using port 8080
lsof -i :8080    # macOS/Linux
netstat -ano | findstr :8080  # Windows

# Kill process or change PORT in .env

PostgreSQL Connection Failed

# Check if container is running
docker ps | grep ownpilot

# Check logs
docker logs ownpilot-db

# Restart container
docker restart ownpilot-db

pnpm Install Failed

Close VS Code (locks native .node modules on Windows) and retry:

pnpm install

Node.js Version Too Old

# Check version
node --version

# Update via nvm (recommended)
nvm install 22
nvm use 22

# Or reinstall from nodejs.org

Additional Resources