Skip to main content

Installation Guide

This guide covers all installation methods for Budgetron, from Docker deployments to manual setup. Choose the method that best fits your infrastructure and requirements.

Prerequisites

System Requirements

For Docker Installation

  • Docker 20.10 or later
  • Docker Compose (optional)
  • 2GB RAM minimum
  • 5GB disk space

For Manual Installation

  • Node.js 18+ (Alpine compatible)
  • pnpm 10.30.3 or later
  • 2GB RAM minimum
  • 10GB disk space

Required Services

Budgetron requires a PostgreSQL database. Ensure you have access to a PostgreSQL instance before proceeding.
  • PostgreSQL 14+ with CREATE TABLE permissions
  • Network access to the database from your Budgetron instance

Optional Services

These services enable additional features:
  • Ollama or OpenAI-compatible API - For AI transaction categorization
  • Email service (e.g., Resend) - For password resets and notifications
  • Vercel Blob or S3-compatible storage - For profile picture uploads

Installation Methods

Database Setup

Creating the Database

Connect to your PostgreSQL server and create the database:
CREATE DATABASE budgetron;
CREATE USER budgetron WITH PASSWORD 'your-secure-password';
GRANT ALL PRIVILEGES ON DATABASE budgetron TO budgetron;

Connection String Format

The DB_URL environment variable should follow this format:
postgresql://[user]:[password]@[host]:[port]/[database]
DB_URL="postgresql://budgetron:password@localhost:5432/budgetron"
Always use SSL connections (?sslmode=require) for hosted databases in production.

Migration Management

Budgetron uses Drizzle ORM for database migrations:
# Generate new migration
pnpm run db:generate

# Apply migrations
pnpm run db:migrate

# Open Drizzle Studio (database GUI)
pnpm run db:studio
In Docker deployments, migrations run automatically on container startup via the entrypoint.sh script.

Post-Installation Configuration

Setting Up AI Categorization

For local AI processing with Ollama:
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull LLaMA 3 model
ollama pull llama3

# Configure Budgetron
OPENAI_COMPATIBLE_PROVIDER="ollama"
OPENAI_COMPATIBLE_BASE_URL="http://localhost:11434/v1"
OPENAI_COMPATIBLE_API_KEY="ollama"
OPENAI_COMPATIBLE_MODEL="llama3"
Other supported models include mixtral, mistral, and any OpenAI-compatible API.

Configuring Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URI: {AUTH_URL}/api/auth/callback/google
  6. Copy Client ID and Secret to .env

Setting Up Email Notifications

Budgetron supports any email provider compatible with the Resend SDK:
EMAIL_PROVIDER_API_KEY="re_..."
EMAIL_PROVIDER_FROM_EMAIL="[email protected]"
Required for:
  • Password reset emails
  • Account deletion confirmations
  • Budget alerts (upcoming feature)

Configuring Cron Jobs

Budgetron uses cron jobs for background tasks like currency rate synchronization:
CRON_SECRET_SLUG="sync-currency-rates"
CRON_SECRET_TOKEN="your-secure-token"
Set up your cron scheduler to call:
POST {AUTH_URL}/api/cron/{CRON_SECRET_SLUG}
Authorization: Bearer {CRON_SECRET_TOKEN}
Use services like cron-job.org or your server’s crontab for scheduling.

Troubleshooting

Common Issues

Symptoms: Container exits with ❌ DB unavailable after 30sSolutions:
  • Verify PostgreSQL is running: pg_isready -h host -p 5432
  • Check firewall rules allow connections
  • Ensure DB_URL format is correct
  • For Docker: Use container name instead of localhost if using Docker networks
  • Increase wait timeout: -e MAX_WAIT=60
Symptoms: Error: relation "users" already existsSolutions:
  • Check if database was previously initialized
  • Verify database user has CREATE TABLE permissions
  • Review migration state: SELECT * FROM __drizzle_migrations;
  • For fresh start: Drop and recreate the database (data loss!)
Symptoms: Login fails or session expires immediatelySolutions:
  • Verify AUTH_SECRET is set and at least 32 characters
  • Ensure AUTH_URL matches the URL you’re accessing
  • Check browser cookies are enabled
  • For HTTPS: Ensure secure cookie settings are correct
Symptoms: Transactions not categorized automaticallySolutions:
  • Verify all AI environment variables are set
  • Check Ollama is running: curl http://localhost:11434
  • Test API endpoint: curl http://localhost:11434/v1/models
  • Review application logs for API errors
Symptoms: Error: Address already in useSolutions:
  • Change Docker port mapping: -p 8080:3000
  • Find conflicting process: lsof -i :3000
  • Stop conflicting service or use different port
Symptoms: Docker build or pnpm build failsSolutions:
  • Ensure sufficient disk space (10GB+)
  • Clear Docker cache: docker builder prune
  • For manual build: Delete node_modules and reinstall
  • Check Node.js version: node --version (requires 18+)

Getting Help

GitHub Issues

Report bugs or request features

Documentation

Browse the full documentation

Next Steps

Now that Budgetron is installed:
1

Create Your First Account

Navigate to your Budgetron URL and sign up
2

Configure Your Budget

Set up budget categories and spending limits
3

Import Transactions

Import existing transactions from CSV or OFX files
4

Enable AI Categorization

Let AI automatically categorize your transactions
For production deployments, see our Production Best Practices guide.

Build docs developers (and LLMs) love