Skip to content

Install

Three ways to run Sleepy: one-command VPS deploy (recommended), Docker Compose, or local development.

Three ways to run Sleepy: one-command VPS deploy (recommended), Docker Compose, or local development.

Prerequisites

  • A VPS with root/sudo access
  • A domain pointing to the VPS IP (A record)
  • Docker + Compose (the one-command script installs Docker if missing)
  • At least one upstream LLM provider key (OpenAI / Anthropic / DeepSeek / Gemini / GroQ) — required for non-free routes

Option A — One-command VPS deploy (recommended)

curl -fsSL https://raw.githubusercontent.com/TahsinArafat/sleepy-ai/main/scripts/deploy.sh | bash -s -- example.com [email protected]

Or run without arguments and answer the prompts interactively:

curl -fsSL https://raw.githubusercontent.com/TahsinArafat/sleepy-ai/main/scripts/deploy.sh | bash

The script does everything:

  1. Installs Docker + Compose if missing
  2. Clones the repo to /opt/sleepy-ai
  3. Generates all secrets (database password, JWT secret, router master key)
  4. Builds and starts every container
  5. Runs database migrations and seeds

Then open https://www.example.com (non-www redirects to www) and log in:

Change the admin password immediately. Everything else (PipraPay, email, Telegram, Google OAuth) is configurable afterwards from Admin → Settings.

Option B — Docker Compose

git clone https://github.com/TahsinArafat/sleepy-ai.git
cd sleepy-ai

cp .env.example .env
# Edit .env — at minimum set DOMAIN, POSTGRES_PASSWORD, NEXTAUTH_SECRET,
# OMNIROUTE_MASTER_KEY and CRON_SECRET. Generate secrets with:
#   openssl rand -base64 32

docker compose up -d --build
docker compose ps          # wait for healthy status

Then open https://www.$DOMAIN (or http://localhost for a local domain).

Migrations run automatically from the dashboard image entrypoint (prisma migrate deploy, with a non-destructive db push fallback). To run them manually:

docker compose exec dashboard npx prisma migrate deploy
docker compose exec dashboard npx tsx scripts/db-init-on-first-boot.ts
docker compose exec dashboard npx tsx prisma/seed.ts

Default admin credentials — change immediately:

Option C — Local development (no Docker)

Prerequisites: Node.js 20+, a local PostgreSQL 16, and Bun for the CLI.

# ── Dashboard ────────────────────────────────────────────────────────────────
cd dashboard
npm install
npx prisma generate
npx prisma migrate deploy          # or: npx prisma db push  (non-destructive)
npx tsx scripts/db-init-on-first-boot.ts
npm run dev                        # → http://localhost:3000

# ── Chat (second terminal) ───────────────────────────────────────────────────
cd chat
npm install
npx prisma generate
npx prisma migrate deploy
npm run dev                        # → http://localhost:3001

# ── Telegram bot ─────────────────────────────────────────────────────────────
cd dashboard
npm run dev:bot                    # tsx watch scripts/telegram-bot.ts

# ── Search sidecar ───────────────────────────────────────────────────────────
cd search
uv sync
uv run uvicorn main:app --host 0.0.0.0 --port 8001

Point .env's DATABASE_URL at your local Postgres for the dashboard, and set DASHBOARD_INTERNAL_URL=http://localhost:3000 and SEARCH_API_URL=http://localhost:8001 for a locally-run chat app.

What happens on first boot

The dashboard entrypoint runs prisma migrate deploy then a first-boot initializer, which seeds only once (guarded by a database_initialized marker in SystemSetting):

  • the admin user ([email protected] / sleepy_admin_123)
  • the default plans (free / pro / enterprise) and their limits

Existing plan rows and the admin password are never overwritten on restart, so redeploys don't clobber your data or pricing.

Updating a deployment

cd /opt/sleepy-ai
git pull
docker compose up -d --build

Migrations apply automatically on container start. For a deterministic update (run migrations first, then rebuild):

docker compose build dashboard
docker compose run --rm dashboard npx prisma migrate deploy
docker compose up -d --build

Next: Configuration