
Deploy Invoice Ninja on Your Own Server
Small Business Invoicing & Payments.
Want to deploy Invoice Ninja on your server faster? Try Senate with one-command setup, automatic HTTPS and monitoring.
What is Invoice Ninja?
You will need your own "Invoice Ninja App Key", you can generate a new one with `docker run --rm invoiceninja/invoiceninja php artisan key:generate --show` Detailed instructions in the official [Invoice Ninja Repo](https://github.com/invoiceninja/dockerfiles#alternatively-get-started-with-docker-compose) Some variables have default values and others need to be manually added into the App Config of AppName-app. Check the sample [env file](https://github.com/invoiceninja/invoiceninja/blob/master/.env.example) from the official repo.
Self-Host Invoice Ninja
Follow these steps to deploy on your own server.
Install Docker
Skip this step if Docker is already installed on your server.
curl -fsSL https://get.docker.com | sh
Configure
Customize the settings below. Defaults work for most cases.
General
Deploy
Copy the configuration and run it on your server.
services:
invoiceninja:
environment:
APP_CONTAINER: invoiceninja-app:9000
volumes:
- invoiceninja-app-public:/var/www/app/public
depends_on:
- invoiceninja-app
invoiceninja-app:
environment:
APP_DEBUG: "false"
APP_KEY: ""
APP_URL: http://invoiceninja.your-domain.com
DB_DATABASE: ninja
DB_HOST: invoiceninja-db
DB_PASSWORD: 521af2c98d
DB_PORT: "3306"
DB_USERNAME: ninja
IN_PASSWORD: 7299aac95c
IN_USER_EMAIL: admin@example.com
MAIL_DRIVER: ""
MAIL_ENCRYPTION: ""
MAIL_FROM_ADDRESS: ""
MAIL_FROM_NAME: ""
MAIL_HOST: ""
MAIL_PASSWORD: ""
MAIL_PORT: ""
MAIL_USERNAME: ""
NORDIGEN_SECRET_ID: ""
NORDIGEN_SECRET_KEY: ""
PDF_GENERATOR: snappdf
PHANTOMJS_PDF_GENERATION: "false"
QUEUE_CONNECTION: database
REQUIRE_HTTPS: "false"
TRUSTED_PROXIES: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
volumes:
- invoiceninja-app-public:/var/www/app/public
- invoiceninja-app-storage:/var/www/app/storage
depends_on:
- invoiceninja-db
invoiceninja-db:
image: mariadb:10.4
environment:
MYSQL_DATABASE: ninja
MYSQL_PASSWORD: 521af2c98d
MYSQL_ROOT_PASSWORD: 1f1944bc86
MYSQL_USER: ninja
volumes:
- invoiceninja-db:/var/lib/mysql
invoiceninja-db-backup:
image: selim13/automysqlbackup:2.6-9
environment:
CRON_SCHEDULE: 0 0 * * *
DBEXCLUDE: performance_schema information_schema
DBHOST: invoiceninja-db
EXTRA_OPTS: --single-transaction
PASSWORD: 1f1944bc86
USERNAME: root
volumes:
- invoiceninja-db-backup:/backup
depends_on:
- invoiceninja-db
volumes:
invoiceninja-app-public: {}
invoiceninja-app-storage: {}
invoiceninja-db: {}
invoiceninja-db-backup: {}
Then run:
docker compose up -d
Access
Once started, access your app at http://localhost:80
Why Self-Host Invoice Ninja?
Full Data Ownership
Your data stays on your servers. No third-party access.
No Monthly Fees
Pay only for your server. No per-seat or usage charges.
Complete Control
Customize, backup, and scale on your own terms.
Privacy & Compliance
Meet GDPR, HIPAA, or internal security requirements.
Technical Details
Want to go faster?
Try Senate! Senate handles Docker, HTTPS, updates, and monitoring for you. Deploy any of our 300+ apps with a single command.
Install on any Linux server:
sh -c "$(curl -sSL https://get.senate.sh)"