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
- 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
- Docker (Recommended)
- Manual Setup
Docker Installation
Docker provides the simplest and most reliable way to deploy Budgetron.Step 1: Clone the Repository
Step 2: Configure Environment
Create your environment configuration:.env with your settings:.env
Step 3: Build the Image
Build the Budgetron Docker image:- Base stage: Sets up Node Alpine with PostgreSQL client
- Dependencies stage: Installs all dependencies with pnpm
- Builder stage: Compiles Next.js and migration tooling
- Runner stage: Creates minimal production image
The build process includes
gcompat for Alpine compatibility and postgresql-client for database health checks.Step 4: Run the Container
Start Budgetron with your environment configuration:Advanced Docker Options
Advanced Docker Options
Custom Port:Custom Database Wait Timeout:Mount Logs Volume:
Step 5: Verify Deployment
Check container health:If you see HTML content, Budgetron is running successfully!
Database Setup
Creating the Database
Connect to your PostgreSQL server and create the database:Connection String Format
TheDB_URL environment variable should follow this format:
Migration Management
Budgetron uses Drizzle ORM for database migrations: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:Configuring Google OAuth
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
{AUTH_URL}/api/auth/callback/google - Copy Client ID and Secret to
.env
Setting Up Email Notifications
Budgetron supports any email provider compatible with the Resend SDK:- Password reset emails
- Account deletion confirmations
- Budget alerts (upcoming feature)
Configuring Cron Jobs
Budgetron uses cron jobs for background tasks like currency rate synchronization:Troubleshooting
Common Issues
Database connection refused
Database connection refused
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_URLformat is correct - For Docker: Use container name instead of
localhostif using Docker networks - Increase wait timeout:
-e MAX_WAIT=60
Migration errors
Migration errors
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!)
Authentication not working
Authentication not working
Symptoms: Login fails or session expires immediatelySolutions:
- Verify
AUTH_SECRETis set and at least 32 characters - Ensure
AUTH_URLmatches the URL you’re accessing - Check browser cookies are enabled
- For HTTPS: Ensure secure cookie settings are correct
AI categorization not working
AI categorization not working
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
Port conflicts
Port conflicts
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
Build failures
Build failures
Symptoms: Docker build or
pnpm build failsSolutions:- Ensure sufficient disk space (10GB+)
- Clear Docker cache:
docker builder prune - For manual build: Delete
node_modulesand 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:For production deployments, see our Production Best Practices guide.