Skip to main content
Budgetron can be self-hosted on any infrastructure that supports Docker or Node.js applications. This guide covers deployment options ranging from simple VPS setups to container orchestration platforms.

Prerequisites

Before deploying Budgetron, ensure you have:
  • PostgreSQL Database (version 14 or higher)
  • Node.js 20+ (if running without Docker)
  • Docker (recommended for containerized deployments)
  • 2GB RAM minimum (4GB recommended)
  • 1 CPU core minimum (2+ recommended)
  • 10GB storage (for application and database)

Deployment Options

Option 1: Docker on VPS

The simplest self-hosting approach using a Linux VPS.

1. Set Up PostgreSQL

Install PostgreSQL on your VPS:
Create a database and user:

2. Install Docker

Log out and back in for group changes to take effect.

3. Create Environment File

Create a .env file with your configuration:
Generate secure secrets:

4. Run Budgetron

5. Set Up Reverse Proxy

Install and configure Nginx:
Create Nginx configuration:
Enable the site:
Obtain SSL certificate:

Option 2: Docker Compose Stack

Deploy Budgetron with all dependencies using Docker Compose. Create docker-compose.yml:
Create .env file:
Start the stack:

Option 3: Standalone Node.js

Run Budgetron without Docker.

1. Install Dependencies

2. Clone and Build

3. Configure Environment

4. Run Migrations

5. Start Server

For production, use a process manager:

Option 4: Platform as a Service (PaaS)

Deploy to PaaS platforms with minimal configuration.

Railway

  1. Fork the Budgetron repository
  2. Create new project on Railway
  3. Add PostgreSQL database service
  4. Connect your GitHub repository
  5. Add environment variables in Railway dashboard
  6. Deploy automatically on push

Render

  1. Create new Web Service on Render
  2. Connect repository: https://github.com/budgetron-org/budgetron
  3. Configure:
    • Build Command: pnpm install && pnpm run build
    • Start Command: pnpm start
  4. Add PostgreSQL database
  5. Set environment variables
  6. Deploy

Fly.io

Create fly.toml:
Deploy:

Database Management

Backups

Automate PostgreSQL backups:
Schedule with cron:

Restore from Backup

Updates and Maintenance

Updating Docker Deployment

Updating Docker Compose

Updating Standalone

Monitoring

Container Logs

Resource Usage

Application Health

Check if the application is responding:

Troubleshooting

Database Connection Issues

Verify PostgreSQL is running:

Container Won’t Start

Check logs for errors:
Common issues:
  • Invalid DB_URL format
  • Database not accessible
  • Missing required environment variables

Port Already in Use

Find and kill the process:

Migration Failures

Run migrations manually:

Security Considerations

  • Use strong, unique passwords for database and auth secrets
  • Keep PostgreSQL on localhost or private network
  • Enable SSL/TLS for all external connections
  • Regularly update Budgetron and dependencies
  • Use firewall to restrict access (ufw, iptables)
  • Enable automatic security updates on your VPS
See Production Setup for comprehensive security hardening.

Next Steps