Self-Host Prunebox

Deploy your own privacy-first email cleanup tool

Option 1: Docker Compose (Recommended)

Fastest way to get running

  1. Clone: git clone https://github.com/kazimurtaza/prunebox.git
  2. Copy env file: cp .env.example .env
  3. Edit .env with your values (see below)
  4. Run: docker-compose up -d

Option 2: Pre-built Docker Image

Pull from GitHub Container Registry

docker pull ghcr.io/kazimurtaza/prunebox:latest

Available tags: :latest, :develop, :vX.Y.Z

Option 3: Build from Source

For development or customization

npm installnpm run buildnpm start

Configuration

Required Environment Variables

Add these to your .env file

postgresql://prunebox:password@localhost:5432/prunebox
https://yourdomain.com
openssl rand -base64 32
openssl rand -base64 48
openssl rand -base64 64

Google OAuth Setup

  1. Go to Google Cloud Console
  2. Enable Gmail API
  3. Create OAuth 2.0 credentials (Web application)
  4. Add redirect: https://yourdomain.com/api/auth/callback
  5. Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET

Gmail API Scopes Required

This app uses restricted scopes that require Google verification for production use. Without verification, you're limited to 100 test users.

  • gmail.readonly - Read email headers
  • gmail.modify - Move emails, trash, apply labels
  • gmail.labels - Create/manage labels
  • gmail.send - Send digest emails

Tech Stack

Frontend

Next.js 15, React 19, TypeScript

Backend

Next.js API, PostgreSQL

Deployment

Docker, Prisma

Star on GitHub

Get the source code, report issues, or contribute