Skip to content

The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.

License

Notifications You must be signed in to change notification settings

elie222/inbox-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inbox Zero - your 24/7 AI email assistant

Organizes your inbox, pre-drafts replies, and tracks follow‑ups - so you reach inbox zero faster. Open source alternative to Fyxer, but more customisable and secure.
Website · Discord · Issues

Stars Forks

elie222%2Finbox-zero | Trendshift

Vercel OSS Program

Mission

To help you spend less time in your inbox, so you can focus on what matters.


Deploy with Vercel

Features

  • AI Personal Assistant: Organizes your inbox and pre-drafts replies in your tone and style.
  • Cursor Rules for email: Explain in plain English how your AI should handle your inbox.
  • Reply Zero: Track emails to reply to and those awaiting responses.
  • Smart Categories: Automatically categorize every sender.
  • Bulk Unsubscriber: One-click unsubscribe and archive emails you never read.
  • Cold Email Blocker: Auto‑block cold emails.
  • Email Analytics: Track your activity and trends over time.

Learn more in our docs.

Feature Screenshots

AI Assistant Reply Zero
AI Assistant Reply Zero
Gmail Client Bulk Unsubscriber
Gmail client Bulk Unsubscriber

Demo Video

Inbox Zero demo

Built with

Star History

Star History Chart

Feature Requests

To request a feature open a GitHub issue, or join our Discord.

Getting Started

We offer a hosted version of Inbox Zero at https://getinboxzero.com.

Self-Hosting with Docker

The easiest way to self-host Inbox Zero is using our pre-built Docker image.

See our Self-Hosting Guide for complete instructions.

Local Development Setup

Here's a video on how to set up the project. It covers the same steps mentioned in this document. But goes into greater detail on setting up the external services.

Requirements

Quick Start

  1. Start PostgreSQL and Redis:

    docker compose -f docker-compose.dev.yml up -d
  2. Install dependencies and set up environment:

    pnpm install
    ./docker/scripts/setup-env.sh  # Creates .env with auto-generated secrets
  3. Configure OAuth and LLM:

    Edit apps/web/.env and add:

    • OAuth credentials (at least one required): Google OAuth or Microsoft OAuth
    • LLM provider: Uncomment one provider block and add your API key
  4. Run database migrations:

    cd apps/web
    pnpm prisma migrate dev
  5. Run the development server:

    pnpm dev

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

The setup script auto-generates all required secrets. The sections below cover the services you need to configure manually. For a comprehensive reference of all environment variables, see the Environment Variables Guide.

Google OAuth Setup

Go to Google Cloud Console and create a new project if necessary.

Create new credentials:

  1. If the banner shows up, configure consent screen (if not, you can do this later)

    1. Click the banner, then Click Get Started.
    2. Choose a name for your app, and enter your email.
    3. In Audience, choose External
    4. Enter your contact information
    5. Agree to the User Data policy and then click Create.
    6. Return to APIs and Services using the left sidebar.
  2. Create new credentials:

    1. Click the +Create Credentials button. Choose OAuth Client ID.
    2. In Application Type, Choose Web application
    3. Choose a name for your web client
    4. In Authorized JavaScript origins, add a URI and enter http://localhost:3000 (or your custom domain)
    5. In Authorized redirect URIs enter (or your custom domain):
    • http://localhost:3000/api/auth/callback/google
    • http://localhost:3000/api/google/linking/callback
    • http://localhost:3000/api/google/calendar/callback (only required for calendar integration)
    1. Click Create.
    2. A popup will show up with the new credentials, including the Client ID and secret.
  3. Update .env file:

    1. Copy the Client ID to GOOGLE_CLIENT_ID
    2. Copy the Client secret to GOOGLE_CLIENT_SECRET
  4. Update scopes

    1. Go to Data Access in the left sidebar (or click link above)
    2. Click Add or remove scopes
    3. Copy paste the below into the Manually add scopes box:
    https://www.googleapis.com/auth/userinfo.profile
    https://www.googleapis.com/auth/userinfo.email
    https://www.googleapis.com/auth/gmail.modify
    https://www.googleapis.com/auth/gmail.settings.basic
    https://www.googleapis.com/auth/contacts
    https://www.googleapis.com/auth/calendar (only required for calendar integration)
    
    1. Click Update
    2. Click Save in the Data Access page.
  5. Add yourself as a test user

    1. Go to Audience
    2. In the Test users section, click +Add users
    3. Enter your email and press Save
  6. Enable required APIs in Google Cloud Console:

Google PubSub Setup

PubSub enables real-time email notifications. Follow the official guide:

  1. Create a topic
  2. Create a subscription
  3. Grant publish rights on your topic

Set GOOGLE_PUBSUB_TOPIC_NAME in your .env file.

When creating the subscription, select Push and set the URL to: https://yourdomain.com/api/google/webhook?token=TOKEN

Set GOOGLE_PUBSUB_VERIFICATION_TOKEN in your .env file to the value of TOKEN.

For local development, use ngrok to expose your local server:

ngrok http 3000

Then update the webhook endpoint in the Google PubSub subscriptions dashboard.

Email watch renewal: Gmail watch subscriptions expire periodically and must be renewed. If using Docker Compose, this is handled automatically by the cron container every 6 hours. Otherwise, set up a cron job to call /api/watch/all (see Self-Hosting Guide).

Microsoft OAuth Setup

Go to Microsoft Azure Portal and create a new Azure Active Directory app registration:

  1. Navigate to Azure Active Directory

  2. Go to "App registrations" in the left sidebar or search it in the searchbar

  3. Click "New registration"

    1. Choose a name for your application
    2. Under "Supported account types" select "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"
    3. Set the Redirect URI:
      • Platform: Web
      • URL: http://localhost:3000/api/auth/callback/microsoft
    4. Click "Register"
    5. In the "Manage" menu click "Authentication (Preview)"
    6. Add the following Redirect URIs:
      • http://localhost:3000/api/outlook/linking/callback
      • http://localhost:3000/api/outlook/calendar/callback (only required for calendar integration)
  4. Get your credentials from the Overview tab:

    1. Copy the "Application (client) ID" → this is your MICROSOFT_CLIENT_ID
    2. Go to "Certificates & secrets" in the left sidebar
      • Click "New client secret"
      • Add a description and choose an expiry
      • Click "Add"
      • Copy the Value → this is your MICROSOFT_CLIENT_SECRET (Important: copy Value, not Secret ID)
  5. Configure API permissions:

    1. In the "Manage" menu click "API permissions" in the left sidebar

    2. Click "Add a permission"

    3. Select "Microsoft Graph"

    4. Select "Delegated permissions"

    5. Add the following permissions:

      • openid
      • profile
      • email
      • User.Read
      • offline_access
      • Mail.ReadWrite
      • Mail.Send (only required if NEXT_PUBLIC_EMAIL_SEND_ENABLED=true, which is the default)
      • MailboxSettings.ReadWrite
      • Calendars.Read (only required for calendar integration)
      • Calendars.ReadWrite (only required for calendar integration)
    6. Click "Add permissions"

    7. Click "Grant admin consent" if you're an admin

  6. Update your .env file with the credentials:

    MICROSOFT_CLIENT_ID=your_client_id_here
    MICROSOFT_CLIENT_SECRET=your_client_secret_here
    

LLM Setup

In your .env file, uncomment one of the LLM provider blocks and add your API key:

Users can also change the model in the app on the /settings page.

Local Production Build

To test a production build locally:

# Without Docker
pnpm run build
pnpm start

# With Docker (includes Postgres and Redis)
NEXT_PUBLIC_BASE_URL=http://localhost:3000 docker compose --profile all up --build

Self-Hosting

For production deployments, see our guides:

Contributing to the project

You can view open tasks in our GitHub Issues. Join our Discord to discuss tasks and check what's being worked on.

ARCHITECTURE.md explains the architecture of the project (LLM generated).