# Self-host Invoice Ninja

> Self-hosted invoicing, quotes, and payments for freelancers and small businesses.

- Page: https://levelrail.com/templates/invoice-ninja/
- JSON: https://levelrail.com/templates/invoice-ninja.json
- Category: Finance
- Licence: Elastic-2.0 (Source available)
- Source: https://github.com/invoiceninja/invoiceninja
- Upstream docs: https://invoiceninja.github.io

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 11

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | mariadb | 11 | none | invoiceninja_db_data -> /var/lib/mysql |
| invoiceninja | invoiceninja/invoiceninja | 5 | 80 | invoiceninja_data -> /var/www/app/storage |
| redis | redis | 7.4-alpine | none | invoiceninja_redis_data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | MYSQL_DATABASE | preset |
| db | MYSQL_PASSWORD | generated |
| db | MYSQL_ROOT_PASSWORD | generated |
| db | MYSQL_USER | preset |
| invoiceninja | APP_KEY | generated |
| invoiceninja | APP_URL | preset |
| invoiceninja | DB_DATABASE | preset |
| invoiceninja | DB_HOST | preset |
| invoiceninja | DB_PASSWORD | generated |
| invoiceninja | DB_USERNAME | preset |
| invoiceninja | REDIS_HOST | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy invoice-ninja --name my-invoice-ninja
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/invoice-ninja/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Invoice Ninja on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Invoice Ninja, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mariadb:11, invoiceninja/invoiceninja:5, redis:7.4-alpine is what you deploy there.

Self-host Invoice Ninja, Invoice Ninja docker compose file, deploy Invoice Ninja on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
