DocsInstallation Guide

Installation Guide

Complete guide to setting up StreamVault on your server or local development machine.

System Requirements

RequirementMinimumRecommended
Node.js18.17+20 LTS
npm9+10+
DatabaseSQLite 3.xPostgreSQL 15+
RAM512 MB2 GB+
Storage1 GB10 GB+
OSUbuntu 20.04 / macOS 12Ubuntu 22.04 LTS

Quick Start

If you just want to get running fast, follow these 5 commands. For a full production setup, read the detailed sections below.

git clone https://github.com/yourusername/streamvault.git
cd streamvault
npm install
cp .env.example .env
npm run dev

Installation

1. Clone the repository

Clone StreamVault from GitHub and navigate into the project directory:

git clone https://github.com/yourusername/streamvault.git
cd streamvault

2. Install dependencies

Install all Node.js dependencies:

npm install

Configuration

3. Copy environment file

Copy the example environment file and edit it with your values:

cp .env.example .env

Open .env and fill in the required values:

# Required — your database connection string
DATABASE_URL="file:./dev.db"
# or for PostgreSQL:
# DATABASE_URL="postgresql://user:password@localhost:5432/streamvault"

# Required — generate with: openssl rand -base64 32
NEXTAUTH_SECRET="your-random-secret-here"

# Required — your application URL
NEXTAUTH_URL="http://localhost:3000"
NEXT_PUBLIC_APP_URL="http://localhost:3000"

# Optional — Stripe payment integration
STRIPE_SECRET_KEY="sk_live_..."
STRIPE_PUBLISHABLE_KEY="pk_live_..."

# Optional — Email (SMTP)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_USER="[email protected]"
SMTP_PASS="your-app-password"
SMTP_FROM="StreamVault <[email protected]>"

Environment Variables Reference

VariableDescriptionRequired
DATABASE_URLPostgreSQL or SQLite connection stringRequired
NEXTAUTH_SECRETRandom 32+ character string for session encryptionRequired
NEXTAUTH_URLFull URL of your application (e.g. https://example.com)Required
STRIPE_SECRET_KEYStripe secret key for payment processingOptional
STRIPE_PUBLISHABLE_KEYStripe publishable key for frontend checkoutOptional
SMTP_HOSTSMTP server hostname for outbound emailOptional
SMTP_PORTSMTP port (typically 587 or 465)Optional
SMTP_USERSMTP authentication usernameOptional
SMTP_PASSSMTP authentication passwordOptional
SMTP_FROMFrom address for outbound emailsOptional
NEXT_PUBLIC_APP_URLPublic-facing application URLRequired
ADMIN_EMAILEmail address for the initial admin accountOptional

Database Setup

4. Run Prisma migrations

Apply all database migrations and seed initial data:

npx prisma migrate deploy
npx prisma db seed

This creates all tables and populates the database with default plans, admin user, and sample content.

Running the App

Development mode

npm run dev

The app will be available at http://localhost:3000

5. Build for production

npm run build

Start production server

npm start

Production Deploy

Using PM2 (recommended)

Install PM2 globally and start StreamVault as a managed process:

npm install -g pm2
pm2 start npm --name streamvault -- start
pm2 save
pm2 startup

Nginx configuration

Sample Nginx reverse proxy configuration:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name yourdomain.com www.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }
}

Docker

Using Docker Compose

The easiest way to run StreamVault with Docker:

# Pull and start all services
docker compose up -d

# Run migrations inside the container
docker compose exec app npx prisma migrate deploy
docker compose exec app npx prisma db seed

docker-compose.yml

version: '3.8'

services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgresql://postgres:password@db:5432/streamvault
      - NEXTAUTH_SECRET=your-secret-here
      - NEXTAUTH_URL=http://localhost:3000
    depends_on:
      - db

  db:
    image: postgres:15-alpine
    environment:
      POSTGRES_DB: streamvault
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:

Troubleshooting

Port 3000 already in use

Run `npx kill-port 3000` or specify a different port: `PORT=3001 npm start`

Prisma migration fails

Ensure your DATABASE_URL is correct and the database server is running. For SQLite, confirm the file path is writable.

NEXTAUTH_SECRET is not set

Generate a secret with `openssl rand -base64 32` and add it to your .env file.

npm install fails with ERESOLVE

Try `npm install --legacy-peer-deps` to bypass peer dependency conflicts.

Build error: Module not found

Run `npm install` again to ensure all dependencies are present, then clear `.next` and rebuild.