How to Self-Host SolidInvoice with Docker Compose

What Is SolidInvoice?

SolidInvoice is an open-source invoicing application built with PHP and Symfony. It handles client management, quote generation, invoicing, and payment tracking. Simpler than Invoice Ninja — fewer features but also fewer things to configure. If you need basic invoicing without the complexity of a full-featured billing platform, SolidInvoice gets the job done. GitHub.

Prerequisites

  • A Linux server (Ubuntu 22.04+ recommended)
  • Docker and Docker Compose installed (guide)
  • 2 GB of free disk space
  • 1 GB of RAM (minimum)
  • A domain name (optional, for remote access)

Docker Compose Configuration

Create a docker-compose.yml file:

services:
  solidinvoice:
    image: solidinvoice/solidinvoice:2.3.16
    container_name: solidinvoice
    restart: unless-stopped
    ports:
      - "8765:8765"
    environment:
      # Database connection
      SOLIDINVOICE_DATABASE_HOST: "solidinvoice-db"
      SOLIDINVOICE_DATABASE_PORT: "3306"
      SOLIDINVOICE_DATABASE_NAME: "solidinvoice"
      SOLIDINVOICE_DATABASE_USER: "solidinvoice"
      SOLIDINVOICE_DATABASE_PASSWORD: "solidinvoice-db-password-change-me"
      # Application secret — generate a unique value
      SOLIDINVOICE_APP_SECRET: "change-me-to-a-random-32-char-string"
      # Optional: set your locale
      SOLIDINVOICE_LOCALE: "en"
    volumes:
      - solidinvoice-data:/var/www/html/var
    depends_on:
      - solidinvoice-db
    networks:
      - solidinvoice-net

  solidinvoice-db:
    image: mysql:8.0
    container_name: solidinvoice-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: "root-password-change-me"
      MYSQL_DATABASE: "solidinvoice"
      MYSQL_USER: "solidinvoice"
      MYSQL_PASSWORD: "solidinvoice-db-password-change-me"
    volumes:
      - solidinvoice-db:/var/lib/mysql
    networks:
      - solidinvoice-net

volumes:
  solidinvoice-data:
  solidinvoice-db:

networks:
  solidinvoice-net:

Start the stack:

docker compose up -d

Initial Setup

  1. Open http://your-server:8765 in a browser.
  2. SolidInvoice runs a setup wizard on first launch.
  3. Configure your company details: name, address, logo, currency, and tax rates.
  4. Create your admin account with a strong password.
  5. Add your first client under Clients → New Client.
  6. Create a quote or invoice under Quotes/Invoices → New.

Configuration

Key Features

FeatureSupport
Client managementYes — contacts, addresses, credit notes
QuotesYes — convert to invoices
Recurring invoicesYes — daily, weekly, monthly, yearly
Tax ratesYes — multiple rates, compound tax
Multi-currencyYes
PDF generationYes — built-in
Email sendingYes — via SMTP
Payment trackingManual recording only
APIYes — REST API

SMTP Configuration

To send invoices via email, configure SMTP in the application settings or via environment variables:

environment:
  SOLIDINVOICE_MAILER_DSN: "smtp://user:[email protected]:587"

Customization

SolidInvoice supports:

  • Custom invoice templates (HTML-based)
  • Company logo upload
  • Multiple tax rates per region
  • Invoice numbering format customization
  • Terms and conditions per quote/invoice

Reverse Proxy

Forward traffic to SolidInvoice’s port 8765:

invoices.example.com {
    reverse_proxy solidinvoice:8765
}

See Reverse Proxy Setup for detailed configurations.

Backup

# Database backup
docker exec solidinvoice-db mysqldump -u solidinvoice -p solidinvoice > \
  solidinvoice-backup-$(date +%Y%m%d).sql

# Application data backup
docker run --rm -v solidinvoice-data:/data -v $(pwd):/backup alpine \
  tar czf /backup/solidinvoice-data-$(date +%Y%m%d).tar.gz -C /data .

See Backup Strategy for automated approaches.

Troubleshooting

Setup Wizard Fails to Connect to Database

Symptom: Database connection error during initial setup.

Fix: Ensure MySQL is fully started before SolidInvoice. Check that SOLIDINVOICE_DATABASE_PASSWORD matches MYSQL_PASSWORD exactly:

docker compose logs solidinvoice-db

Wait 30-60 seconds after starting the stack for MySQL to initialize.

Invoice PDF Generation Fails

Symptom: PDF download produces an error or blank file.

Fix: Check that the var directory is writable:

docker exec solidinvoice ls -la /var/www/html/var/

If permissions are wrong, fix them:

docker exec solidinvoice chown -R www-data:www-data /var/www/html/var

Emails Not Sending

Symptom: Invoices are created but email notifications fail silently.

Fix: Verify your SMTP configuration. Test with a simple mail:

docker exec solidinvoice php bin/console swiftmailer:email:send

Check that port 587 is not blocked by your host firewall.

Resource Requirements

  • RAM: 256-512 MB idle, 512 MB - 1 GB under load
  • CPU: Low — PHP handles requests synchronously
  • Disk: Application is small; grows with invoice attachments and PDFs
DeploymentRAMStorage
Solo freelancer (< 100 invoices/year)256-512 MB< 1 GB
Small business (100-1,000 invoices/year)512 MB - 1 GB1-5 GB

Verdict

SolidInvoice is a solid choice for freelancers and small businesses that need basic invoicing without the feature overload of Invoice Ninja. It generates professional PDFs, tracks payments, handles recurring invoices, and manages clients. The key limitation: no payment gateway integration — you record payments manually. For automated payment processing (Stripe, PayPal), choose Invoice Ninja instead. For straightforward “create invoice, email it, mark it paid,” SolidInvoice does the job with less complexity.

Comments