Skip to content

Deploying a Crater App

Introduction

Crater is a powerful open-source invoicing and expense tracking application designed for freelancers and small businesses. Built with Laravel (PHP) and Vue.js, Crater provides a comprehensive suite of financial management tools including invoice generation, expense tracking, payment management, and detailed financial reporting. With its modern, intuitive interface and robust feature set, Crater simplifies the complexities of financial management while maintaining professional standards.

Crater stands out for its:

  • Complete Invoicing Solution: Create, send, and track professional invoices with customizable templates
  • Expense Management: Track and categorize business expenses with receipt uploads
  • Client Portal: Dedicated portal for clients to view invoices, make payments, and download documents
  • Multi-Currency Support: Handle transactions in multiple currencies with automatic exchange rate updates
  • Tax Management: Built-in support for multiple tax types and calculations
  • Payment Integration: Accept online payments through various payment gateways
  • Estimates & Proposals: Create and send estimates that can be converted to invoices
  • Custom Fields: Add custom fields to invoices, estimates, and expenses
  • PDF Generation: Automatically generate professional PDF invoices and reports
  • Reporting: Comprehensive financial reports and analytics dashboards

This comprehensive guide walks you through deploying Crater on Klutch.sh using Docker, including detailed installation steps, database configuration, persistent storage setup, and production-ready best practices for managing your invoicing platform.

Prerequisites

Before you begin, ensure you have the following:

  • A Klutch.sh account
  • A GitHub account with a repository for your Crater project
  • Docker installed locally for testing (optional but recommended)
  • Basic understanding of Docker, PHP/Laravel applications, and database management
  • A MySQL or PostgreSQL database (can be deployed on Klutch.sh or use a managed service)

Installation and Setup

Step 1: Create Your Project Directory

First, create a new directory for your Crater deployment project:

Terminal window
mkdir crater-klutch
cd crater-klutch
git init

Step 2: Create the Dockerfile

Create a Dockerfile in your project root directory. This will define your Crater container configuration:

FROM php:8.2-apache
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
zip \
unzip \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Clone Crater repository
RUN git clone https://github.com/crater-invoice/crater.git /var/www/html/crater \
&& cd /var/www/html/crater \
&& git checkout master
# Set working directory to Crater
WORKDIR /var/www/html/crater
# Install PHP dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Set permissions
RUN chown -R www-data:www-data /var/www/html/crater \
&& chmod -R 755 /var/www/html/crater/storage \
&& chmod -R 755 /var/www/html/crater/bootstrap/cache
# Configure Apache
RUN a2enmod rewrite
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
# Expose HTTP port
EXPOSE 80
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["apache2-foreground"]

Step 3: Create Apache Configuration

Create an apache-config.conf file for Apache virtual host configuration:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/crater/public
<Directory /var/www/html/crater/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Step 4: Create Entrypoint Script

Create a docker-entrypoint.sh script to handle initialization:

#!/bin/bash
set -e
cd /var/www/html/crater
# Wait for database to be ready
echo "Waiting for database..."
until php artisan migrate:status 2>/dev/null; do
echo "Database not ready, waiting..."
sleep 3
done
# Run migrations if needed
if [ ! -f /var/www/html/crater/storage/app/.installed ]; then
echo "Running initial setup..."
php artisan migrate --force
php artisan db:seed --force
touch /var/www/html/crater/storage/app/.installed
fi
# Optimize application
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Execute the main command
exec "$@"

Step 5: Create Environment Configuration

Create a .env.example file to document the required environment variables:

Terminal window
# Application Configuration
APP_NAME=Crater
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=https://example-app.klutch.sh
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=mysql-host
DB_PORT=3306
DB_DATABASE=crater
DB_USERNAME=crater_user
DB_PASSWORD=secure_password_here
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME="${APP_NAME}"
# Session Configuration
SESSION_DRIVER=file
SESSION_LIFETIME=120
# Cache Configuration
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
# Crater Specific Configuration
SANCTUM_STATEFUL_DOMAINS=example-app.klutch.sh
SESSION_DOMAIN=.example-app.klutch.sh
# File Storage
FILESYSTEM_DRIVER=local
# PDF Generation
PDF_DRIVER=snappy

Security Note: Never commit actual passwords or sensitive data to your repository. Use environment variables in Klutch.sh dashboard.

Step 6: Generate Application Key

Before deploying, you need to generate an application key. You can do this locally:

Terminal window
# Using Docker locally
docker run --rm php:8.2-cli php -r "echo 'base64:'.base64_encode(random_bytes(32)).PHP_EOL;"

Save this generated key to use as the APP_KEY environment variable.

Step 7: Test Locally with Docker Compose (Optional)

Create a docker-compose.yml file for local testing:

version: '3.8'
services:
crater:
build: .
ports:
- "8080:80"
environment:
- APP_KEY=base64:your-generated-key-here
- APP_URL=http://localhost:8080
- DB_HOST=mysql
- DB_DATABASE=crater
- DB_USERNAME=crater
- DB_PASSWORD=secret
volumes:
- crater-storage:/var/www/html/crater/storage
depends_on:
- mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_DATABASE=crater
- MYSQL_USER=crater
- MYSQL_PASSWORD=secret
- MYSQL_ROOT_PASSWORD=rootsecret
volumes:
- mysql-data:/var/lib/mysql
volumes:
crater-storage:
mysql-data:

Note: This Docker Compose file is for local development and testing only. Klutch.sh does not support Docker Compose for deployment.

Test locally:

Terminal window
# Build and start services
docker-compose up -d
# View logs
docker-compose logs -f crater
# Access Crater at http://localhost:8080
# Stop services when done
docker-compose down

Step 8: Create Documentation

Create a README.md file with deployment instructions:

# Crater Invoicing Platform
## Deployment on Klutch.sh
This repository contains the Docker configuration for deploying Crater on Klutch.sh.
## Configuration
1. Set up a MySQL database (version 8.0 or higher recommended)
2. Configure environment variables in Klutch.sh dashboard
3. Attach persistent volume for storage
4. Deploy the application
## Environment Variables
Required environment variables:
- `APP_KEY`: Laravel application key (generate with: php artisan key:generate)
- `APP_URL`: Your application URL (e.g., https://example-app.klutch.sh)
- `DB_HOST`: Database hostname
- `DB_DATABASE`: Database name
- `DB_USERNAME`: Database username
- `DB_PASSWORD`: Database password
## Storage
Mount persistent volume at:
- `/var/www/html/crater/storage` - Application storage (uploads, logs, cache)
## First-Time Setup
After deployment, access your Crater installation at your app URL and complete the setup wizard.

Step 9: Push to GitHub

Commit your configuration files to your GitHub repository:

Terminal window
git add Dockerfile apache-config.conf docker-entrypoint.sh .env.example README.md
git commit -m "Add Crater Docker configuration for Klutch.sh deployment"
git remote add origin https://github.com/yourusername/crater-klutch.git
git push -u origin main

Important: Do not commit docker-compose.yml to your production repository as it contains test credentials and is only for local development.


Deploying to Klutch.sh

Now that your Crater project is ready and pushed to GitHub, follow these steps to deploy it on Klutch.sh with persistent storage and database configuration.

Deployment Steps

    1. Log in to Klutch.sh

      Navigate to klutch.sh/app and sign in to your account.

    2. Create a New Project

      Click on “Create Project” and give your project a meaningful name (e.g., “Crater Invoicing”).

    3. Set Up Database

      Before deploying Crater, you need a MySQL database:

      Note: If deploying MySQL on Klutch.sh, configure it with TCP traffic type on port 8000, and set the internal port to 3306 (MySQL’s default port).

    4. Create a New App

      Click on “Create App” within your project and configure the following settings:

    5. Select Your Repository

      • Choose GitHub as your Git source
      • Select the repository containing your Crater Dockerfile
      • Choose the branch you want to deploy (usually main or master)
    6. Configure Traffic Type

      • Traffic Type: Select HTTP (Crater serves a web application via HTTP)
      • Internal Port: Set to 80 (the port Apache listens on inside the container)
    7. Set Environment Variables

      Add the following environment variables for your Crater configuration:

      Application Settings:

      • APP_NAME: Your application name (e.g., Crater)
      • APP_ENV: Set to production
      • APP_KEY: Your generated Laravel application key (e.g., base64:your-key-here)
      • APP_DEBUG: Set to false for production
      • APP_URL: Your full application URL (e.g., https://example-app.klutch.sh)

      Database Settings:

      • DB_CONNECTION: Set to mysql
      • DB_HOST: Your database hostname (e.g., mysql-app.klutch.sh if deployed on Klutch.sh, or external hostname)
      • DB_PORT: Set to 8000 if using Klutch.sh MySQL, or 3306 for external databases
      • DB_DATABASE: Database name (e.g., crater)
      • DB_USERNAME: Database username
      • DB_PASSWORD: Database password (mark as secret)

      Mail Settings (Optional but recommended):

      • MAIL_MAILER: SMTP service (e.g., smtp)
      • MAIL_HOST: SMTP server hostname
      • MAIL_PORT: SMTP port (usually 587 or 2525)
      • MAIL_USERNAME: SMTP username
      • MAIL_PASSWORD: SMTP password (mark as secret)
      • MAIL_ENCRYPTION: Set to tls
      • MAIL_FROM_ADDRESS: Sender email address
      • MAIL_FROM_NAME: Sender name

      Session Configuration:

      • SESSION_DRIVER: Set to file
      • SANCTUM_STATEFUL_DOMAINS: Your app domain (e.g., example-app.klutch.sh)
      • SESSION_DOMAIN: Your app domain with leading dot (e.g., .example-app.klutch.sh)

      Security Note: Always mark sensitive variables like passwords and API keys as secrets in Klutch.sh dashboard.

    8. Attach a Persistent Volume

      This is critical for ensuring your Crater data persists across deployments and restarts:

      • In the Volumes section, click “Add Volume”
      • Mount Path: Enter /var/www/html/crater/storage (this is where Crater stores uploads, invoices, and application data)
      • Size: Choose an appropriate size based on your expected usage (e.g., 10GB for small businesses, 50GB+ for larger operations with many documents)

      Important: Crater requires persistent storage to maintain uploaded files, generated invoices, receipts, and application cache between container restarts.

    9. Configure Additional Settings

      • Region: Select the region closest to your users for optimal performance
      • Compute Resources: Choose CPU and memory based on your needs (minimum 1GB RAM recommended for Crater)
      • Instances: Start with 1 instance (you can scale up later as your business grows)
    10. Deploy Your Application

      Click “Create” to start the deployment. Klutch.sh will:

      • Automatically detect your Dockerfile in the repository root
      • Build the Docker image
      • Attach the persistent volume
      • Start your Crater container
      • Assign a URL for external access

      This process may take several minutes as it builds the image and installs all dependencies.

    11. Complete Initial Setup

      Once deployment is complete, you’ll receive a URL like https://example-app.klutch.sh. Navigate to this URL in your browser to access the Crater setup wizard:

      https://example-app.klutch.sh/admin/onboarding

      The setup wizard will guide you through:

      • Creating your admin account
      • Configuring company information
      • Setting up your first invoice template
      • Configuring basic application settings

      Important: Complete the setup wizard as soon as possible after deployment to secure your Crater installation.


Database Configuration

Using MySQL on Klutch.sh

If you’re deploying MySQL on Klutch.sh alongside Crater:

  1. Create a separate MySQL app in the same project
  2. Configure MySQL with:
    • Traffic Type: TCP
    • Internal Port: 3306
    • Public Port: 8000 (Klutch.sh default for TCP traffic)
  3. Attach persistent storage to MySQL at /var/lib/mysql
  4. Create the database and user:
CREATE DATABASE crater CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'crater_user'@'%' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON crater.* TO 'crater_user'@'%';
FLUSH PRIVILEGES;
  1. In your Crater app, set the environment variables:
    • DB_HOST: mysql-app.klutch.sh (your MySQL app URL)
    • DB_PORT: 8000
    • DB_DATABASE: crater
    • DB_USERNAME: crater_user
    • DB_PASSWORD: secure_password

Using External MySQL Service

For production deployments with higher reliability requirements, consider using a managed MySQL service:

Option 1: DigitalOcean Managed Database

  1. Create a MySQL database cluster on DigitalOcean
  2. Create a database named crater
  3. Get your connection details from the DigitalOcean dashboard
  4. Set environment variables in Klutch.sh:
    DB_HOST=your-db-cluster.db.ondigitalocean.com
    DB_PORT=25060
    DB_DATABASE=crater
    DB_USERNAME=doadmin
    DB_PASSWORD=your-db-password

Option 2: AWS RDS MySQL

  1. Create an RDS MySQL instance on AWS
  2. Configure security groups to allow connections from Klutch.sh
  3. Create the crater database
  4. Set environment variables with your RDS connection details

Option 3: PlanetScale

  1. Create a database on PlanetScale
  2. Get your connection string
  3. Set environment variables in Klutch.sh

Persistent Storage Configuration

Crater requires persistent storage for several critical functions:

Storage Structure

Mount a persistent volume to /var/www/html/crater/storage which contains:

  • storage/app/public - Uploaded files (invoices, receipts, company logos)
  • storage/framework - Application cache, sessions, and compiled views
  • storage/logs - Application logs for debugging and monitoring
  • Small Business (5-50 invoices/month): 5-10 GB
  • Medium Business (50-200 invoices/month): 20-50 GB
  • Large Business (200+ invoices/month): 50-100 GB+

Backup Strategy

Regularly backup your persistent volume to prevent data loss:

  1. Use Klutch.sh volume snapshots (if available)
  2. Export important files periodically to external storage
  3. Maintain database backups separately
  4. Test your restore process regularly

Email Configuration

Crater requires email configuration to send invoices, payment reminders, and notifications to clients.

SMTP Configuration Options

Option 1: Mailgun

Terminal window
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=your-mailgun-username
MAIL_PASSWORD=your-mailgun-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="Your Company Name"

Option 2: SendGrid

Terminal window
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=your-sendgrid-api-key
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="Your Company Name"

Option 3: AWS SES

Terminal window
MAIL_MAILER=smtp
MAIL_HOST=email-smtp.us-east-1.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME=your-ses-username
MAIL_PASSWORD=your-ses-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="Your Company Name"

Testing Email Configuration

After configuring email, test it by:

  1. Creating a test invoice
  2. Sending it to your own email address
  3. Verifying receipt and format

Environment Variables Reference

Complete list of Crater environment variables you can configure in Klutch.sh:

VariableDescriptionRequiredDefault
APP_NAMEApplication nameNoCrater
APP_ENVEnvironment (production/local)Yesproduction
APP_KEYLaravel encryption keyYesNone
APP_DEBUGEnable debug modeNofalse
APP_URLFull application URLYesNone
DB_CONNECTIONDatabase typeYesmysql
DB_HOSTDatabase hostnameYesNone
DB_PORTDatabase portYes3306
DB_DATABASEDatabase nameYesNone
DB_USERNAMEDatabase userYesNone
DB_PASSWORDDatabase passwordYesNone
MAIL_MAILERMail driver (smtp, sendmail)Nosmtp
MAIL_HOSTSMTP hostNoNone
MAIL_PORTSMTP portNo587
MAIL_USERNAMESMTP usernameNoNone
MAIL_PASSWORDSMTP passwordNoNone
MAIL_ENCRYPTIONEncryption type (tls, ssl)Notls
MAIL_FROM_ADDRESSSender emailNoNone
MAIL_FROM_NAMESender nameNo${APP_NAME}
SESSION_DRIVERSession storage driverNofile
CACHE_DRIVERCache storage driverNofile
QUEUE_CONNECTIONQueue driverNosync
SANCTUM_STATEFUL_DOMAINSAPI authentication domainsNoNone
SESSION_DOMAINCookie domainNoNone

Production Best Practices

Security Recommendations

  • Strong Passwords: Use a password manager to generate strong, random passwords for database and admin accounts
  • Environment Variables: Store all sensitive credentials as environment variables in Klutch.sh, never in your Dockerfile or repository
  • HTTPS Only: Klutch.sh provides HTTPS by default; ensure you access Crater only via HTTPS
  • Regular Updates: Keep Crater updated to the latest version for security patches and new features
  • Database Backups: Implement a backup strategy for your MySQL database using automated backups
  • File Backups: Regularly backup your persistent volume containing uploaded files and invoices
  • Access Control: Limit admin access and use strong passwords for all user accounts
  • Email Security: Use SMTP authentication and encryption (TLS) for email sending
  • Session Security: Configure secure session settings with appropriate timeouts
  • API Security: If using Crater’s API, implement proper authentication and rate limiting

Performance Optimization

  • Database Optimization: Ensure your MySQL database has proper indexing and is configured for your workload
  • Caching: Laravel’s caching system is configured by default; monitor cache hit rates
  • File Storage: Consider using S3-compatible object storage for uploaded files in high-volume environments
  • Image Optimization: Optimize uploaded images to reduce storage and bandwidth usage
  • Database Connection Pooling: Use persistent database connections for better performance
  • CDN Integration: Consider using a CDN for static assets if serving global clients
  • Regular Maintenance: Clean up old logs and temporary files periodically
  • Monitor Resources: Watch CPU, memory, and storage usage in Klutch.sh dashboard

Monitoring and Maintenance

Monitor your Crater deployment for:

  • Response Times: Ensure the application loads quickly for users
  • Database Performance: Monitor query execution times and slow queries
  • Storage Usage: Track persistent volume usage and plan for expansion
  • Error Logs: Regularly check /var/www/html/crater/storage/logs for application errors
  • Email Delivery: Monitor email delivery rates and bounce rates
  • Backup Status: Verify that automated backups are running successfully
  • Security Updates: Subscribe to Crater’s release notifications for security updates
  • User Activity: Monitor login attempts and user activity for suspicious behavior

Data Management

  • Invoice Retention: Configure retention policies based on your business and legal requirements
  • Database Cleanup: Periodically archive or remove old data to maintain performance
  • File Organization: Implement a naming convention for uploaded files and documents
  • Export Capabilities: Regularly export financial data for accounting software integration
  • Audit Trail: Enable and maintain audit logs for compliance purposes
  • Client Data Privacy: Ensure compliance with GDPR, CCPA, or other privacy regulations
  • Data Export: Provide clients with data export capabilities as required by law

Customization and Extensions

Custom Invoice Templates

Crater allows customization of invoice templates:

  1. Navigate to SettingsInvoice Settings
  2. Choose from multiple pre-built templates
  3. Customize colors, fonts, and layout
  4. Add your company logo and branding
  5. Preview before saving

Custom Fields

Add custom fields to invoices and estimates:

  1. Go to SettingsCustom Fields
  2. Click “Add Custom Field”
  3. Choose the module (Invoice, Estimate, Payment)
  4. Define field type (Text, Textarea, Number, etc.)
  5. Set as required or optional

Payment Gateway Integration

Configure payment gateways to accept online payments:

Supported Payment Gateways:

  • Stripe
  • PayPal
  • Razorpay
  • Mollie

Configuration Steps:

  1. Navigate to SettingsPayment Modes
  2. Click “Add Payment Mode”
  3. Enter gateway credentials
  4. Enable the payment method
  5. Test with a small transaction

Multi-Language Support

Crater supports multiple languages:

  1. Go to SettingsPreferences
  2. Select your preferred language
  3. Download additional language packs if needed
  4. Set default language for invoices

Troubleshooting

Cannot Access Crater Application

Symptoms: Browser shows connection error or timeout

Solutions:

  • Verify your app is running in the Klutch.sh dashboard
  • Check that the internal port is set to 80
  • Ensure HTTP traffic type is selected
  • Review application logs for startup errors
  • Verify environment variables are set correctly

Database Connection Errors

Symptoms: Crater shows “Database connection failed” or similar errors

Solutions:

  • Verify database credentials in environment variables
  • Check database host and port are correct
  • Ensure database server is running and accessible
  • Test database connectivity from a temporary container
  • Verify database user has proper permissions
  • Check if database exists and is initialized

File Upload Failures

Symptoms: Cannot upload invoices, receipts, or company logo

Solutions:

  • Confirm persistent volume is attached at /var/www/html/crater/storage
  • Check volume has sufficient free space
  • Verify file permissions on storage directory
  • Review PHP upload limits in application logs
  • Check for storage path configuration in environment

Email Not Sending

Symptoms: Invoices not arriving in client inboxes

Solutions:

  • Verify SMTP credentials in environment variables
  • Test SMTP connection separately
  • Check email logs in /var/www/html/crater/storage/logs
  • Verify sender email is authorized by SMTP provider
  • Check for rate limiting or quota issues with email provider
  • Ensure TLS/SSL encryption is configured correctly

Invoice PDF Generation Issues

Symptoms: PDF invoices fail to generate or display incorrectly

Solutions:

  • Check application logs for PDF generation errors
  • Verify required PHP extensions are installed (GD, mbstring)
  • Ensure sufficient memory allocation for PDF generation
  • Test with different invoice templates
  • Verify fonts are properly installed in the container

Performance Issues

Symptoms: Slow page loads, timeouts, or unresponsive interface

Solutions:

  • Monitor CPU and memory usage in Klutch.sh dashboard
  • Consider increasing compute resources
  • Review and optimize database queries
  • Clear application cache: php artisan cache:clear
  • Check for slow database queries
  • Ensure adequate storage I/O performance
  • Review application logs for bottlenecks

Migration Errors

Symptoms: Database migrations fail during deployment

Solutions:

  • Verify database credentials are correct
  • Check database user has CREATE/ALTER permissions
  • Review migration logs for specific errors
  • Ensure database charset is utf8mb4
  • Try running migrations manually in container shell

Upgrading Crater

To upgrade Crater to a new version:

Step 1: Update Dockerfile

Modify your Dockerfile to checkout the desired version:

# Change from:
RUN git clone https://github.com/crater-invoice/crater.git /var/www/html/crater \
&& cd /var/www/html/crater \
&& git checkout master
# To:
RUN git clone https://github.com/crater-invoice/crater.git /var/www/html/crater \
&& cd /var/www/html/crater \
&& git checkout v6.0.0

Step 2: Backup Before Upgrading

Critical: Always backup before upgrading:

  1. Create a snapshot of your persistent volume
  2. Export your database:
    Terminal window
    mysqldump -h your-db-host -u crater_user -p crater > crater-backup.sql
  3. Store backup in a secure location

Step 3: Deploy Update

Terminal window
git add Dockerfile
git commit -m "Upgrade Crater to version 6.0.0"
git push

Klutch.sh will automatically rebuild and redeploy your application. Your data will be preserved in the persistent volume and database.

Step 4: Verify Upgrade

After deployment:

  1. Access your Crater installation
  2. Check version in SettingsAbout
  3. Verify all features work correctly
  4. Test invoice generation and email sending
  5. Review application logs for any errors

Scaling Crater for Growth

Horizontal Scaling

For high-traffic deployments:

  1. Separate Database: Move to a managed MySQL service with read replicas
  2. Object Storage: Use S3-compatible storage for file uploads
  3. Load Balancer: Deploy multiple Crater instances behind a load balancer
  4. Session Storage: Use Redis or database sessions for multi-instance deployments
  5. Cache Layer: Implement Redis for application caching

Vertical Scaling

Increase resources as needed:

  • Start with 1GB RAM, 1 vCPU for small businesses
  • Scale to 2-4GB RAM, 2 vCPUs for medium businesses
  • Use 4-8GB RAM, 4+ vCPUs for large businesses with high transaction volumes

Additional Resources


Conclusion

Deploying Crater to Klutch.sh with Docker provides a robust, scalable invoicing and expense management solution for your business. By following this guide, you’ve set up a production-ready Crater instance with proper database configuration, persistent storage, email integration, and security best practices. Your invoicing platform is now ready to handle professional invoice generation, expense tracking, and financial reporting while maintaining full control over your financial data and business processes.