Skip to content

Self-Hosting Quickstart

Deploy TheTerms on your infrastructure in under 10 minutes. You’ll need Docker and Docker Compose installed.

  • A server with at least 1 CPU core, 2 GB RAM, and 10 GB disk
  • Docker Engine 20+ and Docker Compose v2+
  • A domain name (recommended for HTTPS)
  1. Clone the repository

    Terminal window
    git clone https://github.com/ashwineaso/theterms.git
    cd theterms
  2. Create your environment file

    Terminal window
    cp apps/web/.env.example .env
  3. Configure required variables

    Edit .env and set at minimum:

    Terminal window
    # Generate a secure random secret
    NEXTAUTH_SECRET=$(openssl rand -base64 32)
    # Your public URL
    NEXTAUTH_URL=https://your-domain.com
    # A strong database password
    POSTGRES_PASSWORD=your-strong-password-here

    See Environment Variables for the full reference.

  4. Build and start all services

    Terminal window
    docker compose up -d --build

    This starts three containers:

    • app — TheTerms application (Next.js on port 3000)
    • postgres — PostgreSQL 16 database
    • redis — Redis 7 cache

    Database migrations run automatically on container startup.

  5. Verify the deployment

    Terminal window
    docker compose ps

    All three services should show Up (healthy).

    Open http://your-server:3000 in a browser. You should see the login page.