In today’s digital age, efficient invoicing is crucial for businesses of all sizes. While there are numerous cloud-based solutions available, self-hosting your invoicing software offers greater control, privacy, and customization options. InvoiceShelf is an excellent open-source option that can be easily self-hosted using Docker. This guide will walk you through the entire process of setting up InvoiceShelf on your own server.
What is InvoiceShelf?
InvoiceShelf is a powerful open-source invoicing application designed for individuals and businesses. It’s a fork of Crater that focuses on stability, updates, and new features. Built with Laravel and VueJS for the web application and React Native for mobile apps, InvoiceShelf offers a modern and user-friendly interface.
Key Features
- Professional Invoice & Estimate Creation: Create customizable, professional-looking invoices and estimates.
- Expense Tracking: Keep track of all your business expenses in one place.
- Payment Management: Record and manage payments from clients.
- Multi-Currency Support: Work with clients globally using multiple currencies.
- Customizable Tax Rates: Set up different tax rates for various products or services.
- Recurring Invoices: Automate billing for regular clients.
- Multiple Companies: Manage multiple businesses within a single installation.
- Customer Portal: Allow clients to view and pay invoices online.
- PDF Customization: Create custom templates for your PDF invoices and estimates.
- Multilingual Support: Available in multiple languages including English, French, German, Dutch, Arabic, and more.
Docker Installation
Docker simplifies the deployment process by packaging InvoiceShelf with all its dependencies into a container. This approach ensures consistent behavior across different environments and makes installation and updates much easier.
Prerequisites
- A server or computer with Docker and Docker Compose installed
- Basic knowledge of Docker and command-line operations
- A domain name (optional, but recommended for production use)
Step 1: Install Docker
If you haven’t already installed Docker, you can follow the official instructions for your operating system at https://docs.docker.com/install/.
Step 2: Clone the Docker Repository
Open your terminal and clone the InvoiceShelf Docker repository:
1 2 3 |
git clone https://github.com/InvoiceShelf/docker |
Step 3: Prepare Docker Compose
Navigate to the cloned repository folder and copy one of the example files to create your docker-compose.yml
file:
1 2 3 |
cd docker |
Choose the database option you prefer:
For SQLite (simplest option, no additional database server required):
1 2 3 |
cp docker-compose.sqlite.yml docker-compose.yml |
For MySQL:
1 2 3 |
cp docker-compose.mysql.yml docker-compose.yml |
For PostgreSQL:
1 2 3 |
cp docker-compose.pgsql.yml docker-compose.yml |
Step 4: Configure Docker Compose
Edit the docker-compose.yml
file to adjust the configuration to your needs. You may want to modify:
- Port mappings
- Database credentials (if using MySQL or PostgreSQL)
- Time zone settings
- Application URL and domain
- Volume paths for data persistence
Here’s an example of what you might customize in the docker-compose.yml
file:
1 2 3 4 5 6 7 8 9 10 11 |
environment: - PHP_TZ=America/New_York - TIMEZONE=America/New_York - APP_NAME=MyBusinessInvoices - APP_ENV=production - APP_DEBUG=false - APP_URL=https://invoices.yourdomain.com - SESSION_DOMAIN=invoices.yourdomain.com - SANCTUM_STATEFUL_DOMAINS=invoices.yourdomain.com |
Step 5: Launch InvoiceShelf
After configuring your docker-compose.yml
file, start the application with:
1 2 3 |
docker compose up -d |
The -d
flag runs the containers in detached mode, allowing them to run in the background.
Step 6: Complete the Installation Wizard
Open your web browser and navigate to the URL you specified in your configuration (or http://localhost:YOUR_PORT
if you’re running it locally). You’ll be greeted with the InvoiceShelf installation wizard.
Follow the steps in the wizard to complete the setup:
- Accept the license agreement
- Choose your language
- Configure your database connection:
- For SQLite: Leave the default path as is
- For MySQL/PostgreSQL:
- Database Host:
invoiceshelf
(or as specified in your docker-compose.yml) - Database Name:
invoiceshelf
(or as specified in your docker-compose.yml) - Database Username:
invoiceshelf
(or as specified in your docker-compose.yml) - Database Password: The password you set in your docker-compose.yml
- Database Host:
- Create your admin account
- Configure your company information
Once the installation wizard is complete, you’ll be redirected to the login page where you can start using InvoiceShelf.
Docker Image Tags and Versions
InvoiceShelf provides different Docker image tags to suit various deployment scenarios:
Docker Tag | Purpose | Source Branch | Build Frequency |
---|---|---|---|
:latest , :number (e.g., :2.1.0 ) | Latest stable released version | master (stable release) | On release |
:nightly , :dev | Latest stable unreleased version | master (pending release) | Nightly |
:alpha | Latest alpha/unstable version | develop (latest code) | Nightly |
Which Tag Should You Use?
- For production environments: Use
:latest
or a specific version number like:2.1.0
for stability - For testing environments: Use
:nightly
or:dev
to get features that will be in the next release - For development/adventurous users: Use
:alpha
to get the very latest code (may be unstable)
Advanced Configuration Options
Environment Variables
InvoiceShelf’s Docker image supports numerous environment variables to customize your installation. Here are some of the most important ones:
- App Configuration:
APP_NAME
: Your application name (default: InvoiceShelf)APP_ENV
: Application environment (production, local, etc.)APP_DEBUG
: Enable debug mode (true/false)APP_URL
: Your application URL
- Database Configuration:
DB_CONNECTION
: Database type (sqlite, mysql, pgsql)DB_HOST
: Database host (for MySQL/PostgreSQL)DB_PORT
: Database portDB_DATABASE
: Database nameDB_USERNAME
: Database usernameDB_PASSWORD
: Database password
- Session and Security:
SESSION_DOMAIN
: Your domain for session cookiesSANCTUM_STATEFUL_DOMAINS
: Domains for API authentication
- Docker-specific:
PHP_TZ
: PHP timezoneTIMEZONE
: Application timezoneSTARTUP_DELAY
: Delay before starting services (useful for database dependencies)
Using Docker Secrets
For sensitive information like passwords, you can use Docker secrets instead of environment variables:
1 2 3 4 5 6 7 |
environment: - DB_PASSWORD_FILE=/run/secrets/db_password secrets: db_password: file: ./db_password.txt |
Supported secret files include:
DB_PASSWORD_FILE
REDIS_PASSWORD_FILE
MAIL_PASSWORD_FILE
ADMIN_PASSWORD_FILE
Custom PHP and Nginx Configuration
To customize PHP configuration:
- Mount a custom php.ini file to
/etc/php/8.2/fpm/php.ini
, or - Override specific parameters using PHP_VALUE directive in a custom nginx.conf file
To customize Nginx configuration:
- Use the default.conf file as a base
- Modify it according to your needs
- Mount it to
/etc/nginx/nginx.conf
Additional Nginx directives can be added by mounting files to /etc/nginx/conf.d/
.
Thoughts
Self-hosting InvoiceShelf with Docker provides you with a powerful invoicing solution that you fully control. The Docker installation process makes it easy to get started, even if you’re not experienced with server administration.
With InvoiceShelf, you can create professional invoices, track expenses, manage payments, and much more—all while keeping your data private and secure on your own infrastructure.