
Deploy Invoice Ninja
Self-hosted invoicing with working PDFs, queue and daily backups
Just deployed
Invoice Ninja
Just deployed
/var/www/html/storage
MySQL
Just deployed
/var/lib/mysql
Backups
Bucket
Just deployed
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.
Template Content
Invoice Ninja
zer0gravity98/invoice-ninja-railwayIN_USER_EMAIL
Your email address. It becomes the admin login created on first boot.
MySQL
mysql:9.4Backups
Bucket
