Self-hosted invoicing means the app that holds your clients, invoices and payment history runs on a server you control. For a lot of developers, homelab owners and privacy-minded businesses, that is the whole point. You choose where the data lives, you can read the code, and nobody can change the terms on you.
This guide walks through running SolidInvoice, our open source invoicing software, with Docker from start to finish: a quick local test, a production Docker Compose stack with a database and HTTPS, the first-run setup wizard, backups and upgrades. Every command comes from the official SolidInvoice docs and image, so you can copy them as they are.
At the end there is an honest look at what self-hosting costs you each month in time, and a shortcut if you decide you'd rather not.
What you need before you start
- A server. A small VPS or a home server works. The SolidInvoice download page lists 2GB RAM and 1GB of disk for Docker, and the official image is published for both
amd64andarm64, so a Raspberry Pi class ARM board or an ARM cloud instance is fine. - Docker and Docker Compose. Install Docker Engine with the Compose plugin from docs.docker.com. Docker Desktop on macOS or Windows (WSL2) works for testing.
- A domain name for production, with a DNS
A(orAAAA) record pointing at your server's public IP, for exampleinvoices.example.com. - Ports 80 and 443 open to the internet, so the reverse proxy can get a free Let's Encrypt certificate.
You don't need PHP, Composer, Nginx or a cron job on the host. The image bundles its own PHP runtime and web server.
Step 1: Try it locally in one command
Before you set up a domain, check that the image runs on your machine:
docker run -d -p 8765:8765 -v solidinvoice_data:/etc/solidinvoice solidinvoice/solidinvoice
What each part does:
solidinvoice/solidinvoiceis the official image on Docker Hub.-p 8765:8765publishes the app's port. The container listens on8765. Change the left-hand number to use a different host port.-v solidinvoice_data:/etc/solidinvoicestores the app's config and data in a named volume, so it survives restarts and image upgrades.
Check that it is up:
curl http://localhost:8765/health
It returns OK when the app is running. Open http://localhost:8765 in your browser and you'll be sent to the setup wizard. For a quick test you can click through it with the SQLite option and poke around. For a real install, keep reading.
Step 2: Write a production docker-compose.yml
For anything you will send real invoices from, run SolidInvoice behind a reverse proxy that handles HTTPS. The stack below has three services:
db: MySQL 8.0, the same database the official compose example uses.app: SolidInvoice. Inside the container it serves plain HTTP and trusts the proxy'sX-Forwarded-*headers.caddy: Caddy, which gets and renews a Let's Encrypt certificate automatically.
Create a folder on your server, for example ~/solidinvoice, and save this as docker-compose.yml:
services:
db:
image: "mysql:8.0"
restart: always
environment:
MYSQL_DATABASE: solidinvoice
MYSQL_USER: solidinvoice
MYSQL_PASSWORD: replace-with-a-long-random-password
MYSQL_ROOT_PASSWORD: replace-with-another-long-random-password
volumes:
- db_data:/var/lib/mysql
app:
image: "solidinvoice/solidinvoice:latest"
restart: always
depends_on:
- db
volumes:
- app_data:/etc/solidinvoice
caddy:
image: "caddy:2"
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
db_data: {}
app_data: {}
caddy_data: {}
caddy_config: {}
A few notes on how this differs from the example in the SolidInvoice repository:
- Database passwords. The repo's example uses an empty MySQL root password to keep things simple. The docs warn against that in production and tell you to set
MYSQL_ROOT_PASSWORDandMYSQL_PASSWORDand useMYSQL_USER, which is what this file does. Generate the passwords with something likeopenssl rand -base64 32. - No published app port. The
appservice has noportsentry. Only Caddy is exposed to the internet, and it reaches the app over the internal Compose network atapp:8765. - Pin a version in production.
latestalways pulls the newest release. If you'd rather upgrade on your own schedule, replace it with a version tag. The current release is listed on the download page, and Docker Hub also publishes major and minor tags such as3and3.1.
Prefer SQLite?
For a one-person business, SQLite is a reasonable choice and the docs recommend it for small installs. Delete the db service, the depends_on lines and the db_data volume, then pick Embedded Database (SQLite) in the wizard. The database file is created in the config directory, /etc/solidinvoice, which is already on the app_data volume.
Step 3: Add HTTPS with Caddy
Save this as Caddyfile next to docker-compose.yml, with your own domain:
invoices.example.com {
reverse_proxy app:8765
}
That is the whole config. When Caddy starts, it requests a certificate for the domain from Let's Encrypt, redirects HTTP to HTTPS and renews the certificate before it expires. The certificate is stored in the caddy_data volume so restarts don't trigger a new request.
If you already run Nginx, Traefik or Cloudflare in front of your services, use that instead and point it at port 8765 of the container. One thing to watch: the setup wizard streams its progress with Server-Sent Events. If the install screen stalls, your proxy is buffering the response. On Nginx, set proxy_buffering off; on the SolidInvoice location.
Step 4: Start the stack
docker compose up -d
docker compose ps
All three services should show as running. If Caddy can't get a certificate, check docker compose logs caddy. The usual cause is DNS that hasn't propagated yet, or a firewall blocking port 80 or 443.
Step 5: Run the setup wizard
Open https://invoices.example.com. On a fresh install SolidInvoice redirects you to /install. The Docker image bundles its own PHP runtime, so the wizard skips the system requirements check and goes from the welcome screen straight to the database step.
- Database. Choose MySQL and enter the details from your compose file: host
db, usersolidinvoice, the password you set inMYSQL_PASSWORD, and database namesolidinvoice. Leave the port blank to use the default. SolidInvoice checks the connection before moving on. - Your account. Set the Application URL to your public
https://address, then choose your locale and enter the name, email and password for the admin user. - Review and install. The wizard generates the app secret, creates the database schema and saves your admin account, showing live logs for each step. If a step fails, open its logs, fix the issue and click Retry.
- Launch. Click Launch SolidInvoice and sign in.
The full walkthrough with screenshots is in the system installation docs.
What about cron jobs and queue workers?
With Docker there's nothing to set up. Recurring invoices, scheduled tasks and email sending run on a background worker that starts inside the container. A separate cron entry or messenger:consume process is only needed when you install from the distribution package or from Git.
Step 6: Back up your data
Your invoices are financial records, so treat backups as part of the install. There are two things to back up.
The app volume (/etc/solidinvoice). It holds SolidInvoice's config file, including the record that the install finished, and the SQLite database if you chose SQLite. Compose prefixes volume names with the project name (the folder name by default), so run docker volume ls to find the exact name. Then:
docker compose stop app
docker run --rm -v solidinvoice_app_data:/data -v "$(pwd)":/backup alpine \
tar czf /backup/solidinvoice-app-$(date +%F).tar.gz -C /data .
docker compose start app
Stopping the app first gives you a consistent copy of a SQLite database.
The MySQL database. Dump it while it runs:
docker compose exec -T db sh -c 'exec mysqldump -uroot -p"$MYSQL_ROOT_PASSWORD" solidinvoice' > solidinvoice-db-$(date +%F).sql
Put both commands in a script, run it nightly from cron on the host, and copy the files somewhere other than the server itself, such as object storage or another machine. A backup that lives on the same disk as the database won't help when that disk fails.
Test a restore at least once. Spin up the stack on a spare machine, load the dump and the volume, and make sure you can log in and open an invoice.
For an extra copy that doesn't depend on Docker at all, SolidInvoice can export everything in a company (clients, contacts, invoices, quotes and payments) as a single archive from Data Export in your profile menu.
Step 7: Upgrade SolidInvoice
Back up first, then pull the new image and recreate the container:
docker compose pull
docker compose up -d
docker compose exec app solidinvoice version
The last command prints the version that is now running. Since 3.1.2, the built-in server runs database migrations once at startup, before it serves any request, so there's no separate migration command to run in Docker.
Before each upgrade, read the release notes on GitHub and the repository's UPGRADE.md. Most releases need nothing from you, but some do. 3.1.1, for example, required API tokens created under 3.1.0 to be regenerated.
The ongoing work of self-hosting
Getting SolidInvoice running takes an afternoon. Keeping it running is a small, permanent job, and it is worth being honest about what it involves:
- Updates. Watch for new SolidInvoice releases, plus security updates for your server's OS, Docker, MySQL and Caddy images. Falling behind is how self-hosted apps get compromised.
- Backups. Checking that the nightly job still runs and that a restore still works.
- Certificates and DNS. Caddy renews certificates automatically, but if DNS, the firewall or the server's IP changes, renewals fail and clients see a browser warning on your pay links.
- Email deliverability. Invoices and reminders only work if they land in your clients' inboxes, which is your responsibility on your own server.
- Uptime. If the server goes down at the end of the month, so does your invoicing.
If you already run a homelab or manage servers for a living, this is routine. If you don't, it is a real cost on top of the VPS bill, which is typically $5 to $20 a month. We compare the full numbers in open source vs paid invoicing software: the real cost, and the cloud vs self-hosted comparison lays out the trade-offs side by side.
Or skip it
The hosted version of SolidInvoice runs the same codebase as the self-hosted one. The only exception is invoice and quote templates, which are cloud-only. We handle the servers, updates, backups and SSL.
You can start on the Free plan with no credit card, and paid plans start at $9 a month. If you want to try Pro features like automatic payment reminders and API access, you can start an optional 30-day Pro trial later from inside the app, also with no card. See pricing for what each plan includes.
If you change your mind later, you can export your data and move in either direction.
Start free with SolidInvoice, or grab the self-hosted version from the download page.
Self-hosted invoicing FAQ
Is self-hosted invoicing software free?
The software can be. SolidInvoice is MIT licensed, so you can download, run and modify it without paying for a licence. You still pay for the server it runs on, a domain, and your own time for updates and backups.
Do I need a cron job or queue worker for SolidInvoice in Docker?
No. The Docker image runs the background worker for you, so recurring invoices, scheduled tasks and email sending work without a separate cron job or messenger consumer. You only set up a worker yourself when you install from the distribution package or from Git.
Can I use SQLite instead of MySQL?
Yes. Pick Embedded Database (SQLite) in the setup wizard and SolidInvoice creates the database file in its config directory, which is /etc/solidinvoice inside the container. The docs recommend SQLite for small installs. MySQL, MariaDB and PostgreSQL are also supported.
How do I update SolidInvoice in Docker?
Back up first, then pull the new image and recreate the container with docker compose pull and docker compose up -d. Since 3.1.2 the built-in server runs database migrations once at startup, before it serves any request.
Can I move from self-hosted to the hosted version later?
Yes. Export your data and the SolidInvoice team will help you import it into the hosted plan.
SolidInvoice is open source invoicing software for freelancers and small businesses, developed in the open since 2013. Self-host it from the download page, or start free on the hosted version.
Get new guides as they're published: Subscribe via RSS