> ## Documentation Index
> Fetch the complete documentation index at: https://abacuslabs.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosting Abacus

> An end-to-end guide on how to self-host Abacus

# Self-hosting Abacus

Abacus can be self-hosted on your own infrastructure. This guide covers what you need to run the full platform.

## Architecture Overview

A self-hosted Abacus deployment consists of:

| Component | Technology | Purpose |
| - | - | - |
| **Dashboard** | Next.js | Main application UI |
| **API** | Hono + tRPC | Backend API server |
| **Engine** | Cloudflare Workers / Node.js | Bank connection proxy (Plaid) |
| **Database** | PostgreSQL (Supabase) | Data storage, auth, file storage |
| **Cache** | Redis | Background job queue, caching |
| **Background Jobs** | BullMQ | Async processing (bank syncs, email, etc.) |

## Prerequisites

* [Bun](https://bun.sh/) runtime
* [Docker](https://www.docker.com/) and Docker Compose
* A domain name with DNS access
* SSL certificates (or a reverse proxy like Nginx/Caddy)

## Required Services

You'll need accounts with the following services:

| Service | Purpose | Required? |
| - | - | - |
| [Supabase](https://supabase.com/) | Database, Auth, Storage | Yes |
| [Vercel](https://vercel.com/) or equivalent | Frontend hosting | Yes (or any Node.js host) |
| [Resend](https://resend.com/) | Transactional email | Yes |
| [Plaid](https://plaid.com/) | Bank connections | Optional (for bank syncing) |
| [GoACH](https://goach.com/) | ACH payments | Optional (for payment processing) |
| [Stripe](https://stripe.com/) | Subscription billing | Optional (for billing customers) |
| [Twilio](https://twilio.com/) | SMS for collections | Optional (for AI outreach) |

## Environment Variables

Each app requires its own `.env.local` file. Key variables include:

### Dashboard (`apps/dashboard/.env.local`)

```
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
NEXT_PUBLIC_API_URL=
```

### API (`apps/api/.env.local`)

```
SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=
REDIS_URL=
RESEND_API_KEY=
PLAID_CLIENT_ID=
PLAID_SECRET=
GOACH_API_KEY=
```

> [!NOTE]
>
> See the `.env.example` files in each app directory for the full list of required variables.

## Deployment Options

### Option 1: Vercel (Recommended)

Deploy the dashboard and API as separate Vercel projects:

```bash theme={null}
# Dashboard
cd apps/dashboard
vercel deploy --prod

# API
cd apps/api
vercel deploy --prod
```

### Option 2: Docker

Build and run with Docker:

```bash theme={null}
# Build the dashboard
docker build -f apps/dashboard/Dockerfile -t abacus-dashboard .

# Build the API
docker build -f apps/api/Dockerfile -t abacus-api .

# Run with Docker Compose
docker-compose up -d
```

### Option 3: Any Node.js Host

Build and run on any platform that supports Node.js:

```bash theme={null}
bun build
bun start
```

## Database Setup

1. Create a Supabase project (cloud or self-hosted)
2. Run all migrations:
   ```bash theme={null}
   supabase db push
   ```
3. Seed initial data:
   ```bash theme={null}
   bash scripts/reseed.sh
   ```
4. Generate TypeScript types:
   ```bash theme={null}
   supabase gen types
   ```

## Post-Deployment

After deployment, configure:

1. **Custom domain** — Point your domain to the dashboard
2. **API domain** — Point a subdomain (e.g., `api.yourdomain.com`) to the API
3. **Email** — Configure Resend with your sending domain
4. **Bank connections** — Set up Plaid credentials for bank syncing
5. **Portal branding** — Customize colors and logo in Settings > Portal


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.