---
title: "Deploy Invoice Ninja"
description: "Self-hosted invoicing with working PDFs, queue and daily backups"
category: "Other"
url: https://railway.com/deploy/invoice-ninja-1
---

# Deploy Invoice Ninja

Self-hosted invoicing with working PDFs, queue and daily backups

**[Deploy Invoice Ninja on Railway](https://railway.com/template/invoice-ninja-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/invoice-ninja-1/manifest.json

- **Creator:** zer0gravity98's Projects
- **Category:** Other
- **Total deploys:** 1

## Template content

### Backup

- **Source:** https://github.com/zer0gravity98/invoice-ninja-railway
- **Start command:** `/usr/local/bin/backup-db`

### Invoice Ninja

- **Source:** https://github.com/zer0gravity98/invoice-ninja-railway
- **Health check:** /railway_health
- **Public domain:** Yes

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:9.4
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G`

## Buckets

- **Backups**

## Documentation

# Deploy and Host Invoice Ninja on Railway

Invoice Ninja is a free, open-source invoicing app for freelancers and small businesses. It covers invoices, quotes, payments, expenses, time tracking and a client portal, and it takes online payments through Stripe, PayPal and 40+ other gateways. It's a self-hosted alternative to FreshBooks and QuickBooks.

## About Hosting Invoice Ninja

Invoice Ninja v5 is a Laravel app. It needs PHP, a web server, a MySQL database, background queue workers for emails and PDFs, a scheduler for recurring invoices and reminders, and headless Chrome to render PDFs. It also needs persistent storage for logos and documents, and a stable APP_KEY, because gateway and email credentials are encrypted with it. This template packages all of that into the pinned official image, adds nginx, and wires it to Railway MySQL. First boot creates your admin account automatically. A nightly cron job backs up the database to a Railway Bucket and keeps the last 14 backups.

## Common Use Cases

- Sending professional invoices and quotes to clients, with PDF attachments
- Taking card payments online through Stripe, PayPal and other gateways
- Recurring invoices, automatic payment reminders and a client self-service portal
- Tracking expenses, time and projects for a freelance business or small agency

## Dependencies for Invoice Ninja Hosting

- MySQL database (included: Railway MySQL 9.4)
- Persistent volume for uploads (included, mounted at /var/www/html/storage)
- S3-compatible storage for backups (included: Railway Bucket)

### Deployment Dependencies

- Invoice Ninja: https://invoiceninja.com
- Source code: https://github.com/invoiceninja/invoiceninja
- Official Docker image: https://hub.docker.com/r/invoiceninja/invoiceninja-debian
- Template repository and full guide: https://github.com/zer0gravity98/invoice-ninja-railway

### Implementation Details

The only input is your email address. The admin password (`IN_PASSWORD`) and encryption key (`APP_KEY`) are generated for each deploy. Find the password in the Invoice Ninja service's Variables tab and change it after your first login.

Services:

- **Invoice Ninja**: nginx, PHP-FPM, 2 queue workers, the scheduler and Chrome for PDFs. Healthcheck at `/railway_health`.
- **MySQL**: private network only.
- **Backup**: cron at 03:15 UTC. Dumps the database to the bucket, keeps 14, then exits.
- **Backups bucket**: database dumps, plus a nightly archive of uploaded files.

Give the app 1 GB of memory, or 2 GB if you generate many PDFs at once. Email is written to the logs until you set up a provider in Settings → Email Settings. Outbound SMTP needs a Railway Pro plan.

## Why Deploy Invoice Ninja on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Invoice Ninja on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/invoice-ninja-1
