Skip to content

InvoiceNinja

Description / nameInput element
Your domain name

Overview

InvoiceNinja is a self-hosted accounting system with ability to Quote & Invoice Clients, Time Billable-Tasks, Track Expenses, Get Paid.


Deployment

Ideally you should set a unique app key in settings.yml. Generate the key using:

docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show

insert this in the invoiceninja.app_key setting in /opt/sandbox/settings.yml

sb install sandbox-invoiceninja

Usage

Visit https://invoiceninja.iYOUR_DOMAIN_NAMEi.

Log in

Enter email, and password from accounts.yml setting.

Role Defaults

Use the Inventory to customize variables. (1)

  1. Example override

    invoiceninjav5_name: "custom_value"
    

    Avoid overriding variables ending in _default

    When overriding variables that end in _default (like invoiceninjav5_docker_envs_default), you replace the entire default configuration. Future updates that add new default values will not be applied to your setup, potentially breaking functionality.

    Instead, use the corresponding _custom variable (like invoiceninjav5_docker_envs_custom) to add your changes. Custom values are merged with defaults, ensuring you receive updates.

invoiceninjav5_name
# Type: string
invoiceninjav5_name: "invoiceninja"
invoiceninjav5_overwrite_nginx_config
# Type: bool (true/false)
invoiceninjav5_overwrite_nginx_config: true
invoiceninjav5_role_nginx_web_subdomain
# Type: string
invoiceninjav5_role_nginx_web_subdomain: "invoiceninja"
invoiceninjav5_role_nginx_web_domain
# Type: string
invoiceninjav5_role_nginx_web_domain: "{{ user.domain }}"
invoiceninjav5_role_nginx_web_port
# Type: string
invoiceninjav5_role_nginx_web_port: "80"
invoiceninjav5_role_nginx_web_url
# Type: string
invoiceninjav5_role_nginx_web_url: "{{ 'https://' + (lookup('role_var', '_nginx_web_subdomain', role='invoiceninjav5') + '.' + lookup('role_var', '_nginx_web_domain', role='invoiceninjav5')
                                    if (lookup('role_var', '_nginx_web_subdomain', role='invoiceninjav5') | length > 0)
                                    else lookup('role_var', '_nginx_web_domain', role='invoiceninjav5')) }}"
invoiceninjav5_role_nginx_dns_record
# Type: string
invoiceninjav5_role_nginx_dns_record: "{{ lookup('role_var', '_nginx_web_subdomain', role='invoiceninjav5') }}"
invoiceninjav5_role_nginx_dns_zone
# Type: string
invoiceninjav5_role_nginx_dns_zone: "{{ lookup('role_var', '_nginx_web_domain', role='invoiceninjav5') }}"
invoiceninjav5_role_nginx_dns_proxy
# Type: bool (true/false)
invoiceninjav5_role_nginx_dns_proxy: "{{ dns_proxied }}"

Container

invoiceninjav5_role_docker_container
# Type: string
invoiceninjav5_role_docker_container: "{{ invoiceninjav5_name }}"

Image

invoiceninjav5_role_docker_image_pull
# Type: bool (true/false)
invoiceninjav5_role_docker_image_pull: true
invoiceninjav5_role_docker_image_repo
# Type: string
invoiceninjav5_role_docker_image_repo: "invoiceninja/invoiceninja"
invoiceninjav5_role_docker_image_tag
# Type: string
invoiceninjav5_role_docker_image_tag: "5"
invoiceninjav5_role_docker_image
# Type: string
invoiceninjav5_role_docker_image: "{{ lookup('role_var', '_docker_image_repo', role='invoiceninjav5') }}:{{ lookup('role_var', '_docker_image_tag', role='invoiceninjav5') }}"

Envs

invoiceninjav5_role_docker_envs_default
# Type: dict
invoiceninjav5_role_docker_envs_default:
  TZ: "{{ tz }}"
  APP_URL: "{{ lookup('role_var', '_nginx_web_url', role='invoiceninjav5') }}"
  APP_KEY: "{{ invoiceninja.app_key | default('base64:O1S3kAJEDgo92gPkXtxfdCJpoGShgKloUSdcaHMXmoY=', true) }}"
  APP_ENV: "production"
  APP_DEBUG: "false"
  TRUSTED_PROXIES: "*"
  REQUIRE_HTTPS: "true"
  DB_TYPE: "mysql"
  DB_HOST: "mariadb"
  DB_USERNAME: "root"
  DB_PASSWORD: "password321"
  DB_DATABASE: "invoiceninjav5db"
  DB_PORT: "3306"
  PDF_GENERATOR: "hosted_ninja"
  IS_DOCKER: "true"
  PHANTOMJS_PDF_GENERATION: "false"
  IN_USER_EMAIL: "{{ user.email }}"
  IN_PASSWORD: "{{ user.pass }}"
invoiceninjav5_role_docker_envs_custom
# Type: dict
invoiceninjav5_role_docker_envs_custom: {}

Volumes

invoiceninjav5_role_docker_volumes_default
# Type: list
invoiceninjav5_role_docker_volumes_default:
  - "{{ lookup('role_var', '_paths_location', role='invoiceninjav5') }}/public:/var/www/app/public"
  - "{{ lookup('role_var', '_paths_location', role='invoiceninjav5') }}/storage:/var/www/app/storage"
  - "{{ lookup('role_var', '_paths_location', role='invoiceninjav5') }}/php.ini:/usr/local/etc/php/php.ini"
  - "{{ lookup('role_var', '_paths_location', role='invoiceninjav5') }}/php-cli.ini:/usr/local/etc/php/php-cli.ini"
invoiceninjav5_role_docker_volumes_custom
# Type: list
invoiceninjav5_role_docker_volumes_custom: []

Hostname

invoiceninjav5_role_docker_hostname
# Type: string
invoiceninjav5_role_docker_hostname: "{{ invoiceninjav5_name }}"

Networks

invoiceninjav5_role_docker_networks_alias
# Type: string
invoiceninjav5_role_docker_networks_alias: "{{ invoiceninjav5_name }}"
invoiceninjav5_role_docker_networks_default
# Type: list
invoiceninjav5_role_docker_networks_default: []
invoiceninjav5_role_docker_networks_custom
# Type: list
invoiceninjav5_role_docker_networks_custom: []

Restart Policy

invoiceninjav5_role_docker_restart_policy
# Type: string
invoiceninjav5_role_docker_restart_policy: unless-stopped

State

invoiceninjav5_role_docker_state
# Type: string
invoiceninjav5_role_docker_state: started

Dependencies

invoiceninjav5_role_depends_on
# Type: string
invoiceninjav5_role_depends_on: "invoiceninja-nginx,mariadb"
invoiceninjav5_role_depends_on_delay
# Type: string (quoted number)
invoiceninjav5_role_depends_on_delay: "0"
invoiceninjav5_role_depends_on_healthchecks
# Type: string ("true"/"false")
invoiceninjav5_role_depends_on_healthchecks: "false"

The following advanced options are available via create_docker_container but are not defined in the role. See: docker_container module

Resource Limits

invoiceninjav5_role_docker_blkio_weight
# Type: int
invoiceninjav5_role_docker_blkio_weight:
invoiceninjav5_role_docker_cpu_period
# Type: int
invoiceninjav5_role_docker_cpu_period:
invoiceninjav5_role_docker_cpu_quota
# Type: int
invoiceninjav5_role_docker_cpu_quota:
invoiceninjav5_role_docker_cpu_shares
# Type: int
invoiceninjav5_role_docker_cpu_shares:
invoiceninjav5_role_docker_cpus
# Type: string
invoiceninjav5_role_docker_cpus:
invoiceninjav5_role_docker_cpuset_cpus
# Type: string
invoiceninjav5_role_docker_cpuset_cpus:
invoiceninjav5_role_docker_cpuset_mems
# Type: string
invoiceninjav5_role_docker_cpuset_mems:
invoiceninjav5_role_docker_kernel_memory
# Type: string
invoiceninjav5_role_docker_kernel_memory:
invoiceninjav5_role_docker_memory
# Type: string
invoiceninjav5_role_docker_memory:
invoiceninjav5_role_docker_memory_reservation
# Type: string
invoiceninjav5_role_docker_memory_reservation:
invoiceninjav5_role_docker_memory_swap
# Type: string
invoiceninjav5_role_docker_memory_swap:
invoiceninjav5_role_docker_memory_swappiness
# Type: int
invoiceninjav5_role_docker_memory_swappiness:
invoiceninjav5_role_docker_shm_size
# Type: string
invoiceninjav5_role_docker_shm_size:

Security & Devices

invoiceninjav5_role_docker_cap_drop
# Type: list
invoiceninjav5_role_docker_cap_drop:
invoiceninjav5_role_docker_cgroupns_mode
# Type: string
invoiceninjav5_role_docker_cgroupns_mode:
invoiceninjav5_role_docker_device_cgroup_rules
# Type: list
invoiceninjav5_role_docker_device_cgroup_rules:
invoiceninjav5_role_docker_device_read_bps
# Type: list
invoiceninjav5_role_docker_device_read_bps:
invoiceninjav5_role_docker_device_read_iops
# Type: list
invoiceninjav5_role_docker_device_read_iops:
invoiceninjav5_role_docker_device_requests
# Type: list
invoiceninjav5_role_docker_device_requests:
invoiceninjav5_role_docker_device_write_bps
# Type: list
invoiceninjav5_role_docker_device_write_bps:
invoiceninjav5_role_docker_device_write_iops
# Type: list
invoiceninjav5_role_docker_device_write_iops:
invoiceninjav5_role_docker_devices
# Type: list
invoiceninjav5_role_docker_devices:
invoiceninjav5_role_docker_devices_default
# Type: string
invoiceninjav5_role_docker_devices_default:
invoiceninjav5_role_docker_groups
# Type: list
invoiceninjav5_role_docker_groups:
invoiceninjav5_role_docker_privileged
# Type: bool (true/false)
invoiceninjav5_role_docker_privileged:
invoiceninjav5_role_docker_security_opts
# Type: list
invoiceninjav5_role_docker_security_opts:
invoiceninjav5_role_docker_user
# Type: string
invoiceninjav5_role_docker_user:
invoiceninjav5_role_docker_userns_mode
# Type: string
invoiceninjav5_role_docker_userns_mode:

Networking

invoiceninjav5_role_docker_dns_opts
# Type: list
invoiceninjav5_role_docker_dns_opts:
invoiceninjav5_role_docker_dns_search_domains
# Type: list
invoiceninjav5_role_docker_dns_search_domains:
invoiceninjav5_role_docker_dns_servers
# Type: list
invoiceninjav5_role_docker_dns_servers:
invoiceninjav5_role_docker_domainname
# Type: string
invoiceninjav5_role_docker_domainname:
invoiceninjav5_role_docker_exposed_ports
# Type: list
invoiceninjav5_role_docker_exposed_ports:
invoiceninjav5_role_docker_hosts
# Type: dict
invoiceninjav5_role_docker_hosts:
invoiceninjav5_role_docker_hosts_use_common
# Type: bool (true/false)
invoiceninjav5_role_docker_hosts_use_common:
invoiceninjav5_role_docker_ipc_mode
# Type: string
invoiceninjav5_role_docker_ipc_mode:
invoiceninjav5_role_docker_links
# Type: list
invoiceninjav5_role_docker_links:
invoiceninjav5_role_docker_network_mode
# Type: string
invoiceninjav5_role_docker_network_mode:
invoiceninjav5_role_docker_pid_mode
# Type: string
invoiceninjav5_role_docker_pid_mode:
invoiceninjav5_role_docker_ports
# Type: list
invoiceninjav5_role_docker_ports:
invoiceninjav5_role_docker_uts
# Type: string
invoiceninjav5_role_docker_uts:

Storage

invoiceninjav5_role_docker_keep_volumes
# Type: bool (true/false)
invoiceninjav5_role_docker_keep_volumes:
invoiceninjav5_role_docker_mounts
# Type: list
invoiceninjav5_role_docker_mounts:
invoiceninjav5_role_docker_storage_opts
# Type: dict
invoiceninjav5_role_docker_storage_opts:
invoiceninjav5_role_docker_tmpfs
# Type: list
invoiceninjav5_role_docker_tmpfs:
invoiceninjav5_role_docker_volume_driver
# Type: string
invoiceninjav5_role_docker_volume_driver:
invoiceninjav5_role_docker_volumes_from
# Type: list
invoiceninjav5_role_docker_volumes_from:
invoiceninjav5_role_docker_volumes_global
# Type: bool (true/false)
invoiceninjav5_role_docker_volumes_global:
invoiceninjav5_role_docker_working_dir
# Type: string
invoiceninjav5_role_docker_working_dir:

Monitoring & Lifecycle

invoiceninjav5_role_docker_auto_remove
# Type: bool (true/false)
invoiceninjav5_role_docker_auto_remove:
invoiceninjav5_role_docker_cleanup
# Type: bool (true/false)
invoiceninjav5_role_docker_cleanup:
invoiceninjav5_role_docker_force_kill
# Type: string
invoiceninjav5_role_docker_force_kill:
invoiceninjav5_role_docker_healthcheck
# Type: dict
invoiceninjav5_role_docker_healthcheck:
invoiceninjav5_role_docker_healthy_wait_timeout
# Type: int
invoiceninjav5_role_docker_healthy_wait_timeout:
invoiceninjav5_role_docker_init
# Type: bool (true/false)
invoiceninjav5_role_docker_init:
invoiceninjav5_role_docker_kill_signal
# Type: string
invoiceninjav5_role_docker_kill_signal:
invoiceninjav5_role_docker_log_driver
# Type: string
invoiceninjav5_role_docker_log_driver:
invoiceninjav5_role_docker_log_options
# Type: dict
invoiceninjav5_role_docker_log_options:
invoiceninjav5_role_docker_oom_killer
# Type: bool (true/false)
invoiceninjav5_role_docker_oom_killer:
invoiceninjav5_role_docker_oom_score_adj
# Type: int
invoiceninjav5_role_docker_oom_score_adj:
invoiceninjav5_role_docker_output_logs
# Type: bool (true/false)
invoiceninjav5_role_docker_output_logs:
invoiceninjav5_role_docker_paused
# Type: bool (true/false)
invoiceninjav5_role_docker_paused:
invoiceninjav5_role_docker_recreate
# Type: bool (true/false)
invoiceninjav5_role_docker_recreate:
invoiceninjav5_role_docker_restart_retries
# Type: int
invoiceninjav5_role_docker_restart_retries:
invoiceninjav5_role_docker_stop_timeout
# Type: int
invoiceninjav5_role_docker_stop_timeout:

Other Options

invoiceninjav5_role_docker_capabilities
# Type: list
invoiceninjav5_role_docker_capabilities:
invoiceninjav5_role_docker_cgroup_parent
# Type: string
invoiceninjav5_role_docker_cgroup_parent:
invoiceninjav5_role_docker_commands
# Type: list
invoiceninjav5_role_docker_commands:
invoiceninjav5_role_docker_create_timeout
# Type: int
invoiceninjav5_role_docker_create_timeout:
invoiceninjav5_role_docker_entrypoint
# Type: string
invoiceninjav5_role_docker_entrypoint:
invoiceninjav5_role_docker_env_file
# Type: string
invoiceninjav5_role_docker_env_file:
invoiceninjav5_role_docker_labels
# Type: dict
invoiceninjav5_role_docker_labels:
invoiceninjav5_role_docker_labels_use_common
# Type: bool (true/false)
invoiceninjav5_role_docker_labels_use_common:
invoiceninjav5_role_docker_read_only
# Type: bool (true/false)
invoiceninjav5_role_docker_read_only:
invoiceninjav5_role_docker_runtime
# Type: string
invoiceninjav5_role_docker_runtime:
invoiceninjav5_role_docker_sysctls
# Type: list
invoiceninjav5_role_docker_sysctls:
invoiceninjav5_role_docker_ulimits
# Type: list
invoiceninjav5_role_docker_ulimits:
invoiceninjav5_role_autoheal_enabled
# Enable or disable Autoheal monitoring for the container created when deploying
# Type: bool (true/false)
invoiceninjav5_role_autoheal_enabled: true
invoiceninjav5_role_depends_on
# List of container dependencies that must be running before the container start
# Type: string
invoiceninjav5_role_depends_on: ""
invoiceninjav5_role_depends_on_delay
# Delay in seconds before starting the container after dependencies are ready
# Type: string (quoted number)
invoiceninjav5_role_depends_on_delay: "0"
invoiceninjav5_role_depends_on_healthchecks
# Enable healthcheck waiting for container dependencies
# Type: string ("true"/"false")
invoiceninjav5_role_depends_on_healthchecks:
invoiceninjav5_role_diun_enabled
# Enable or disable Diun update notifications for the container created when deploying
# Type: bool (true/false)
invoiceninjav5_role_diun_enabled: true
invoiceninjav5_role_dns_enabled
# Enable or disable automatic DNS record creation for the container
# Type: bool (true/false)
invoiceninjav5_role_dns_enabled: true
invoiceninjav5_role_docker_controller
# Enable or disable Saltbox Docker Controller management for the container
# Type: bool (true/false)
invoiceninjav5_role_docker_controller: true
invoiceninjav5_role_docker_image_repo
# Type: string
invoiceninjav5_role_docker_image_repo:
invoiceninjav5_role_docker_image_tag
# Type: string
invoiceninjav5_role_docker_image_tag:
invoiceninjav5_role_docker_volumes_download
# Type: bool (true/false)
invoiceninjav5_role_docker_volumes_download:
invoiceninjav5_role_nginx_web_domain
# Type: string
invoiceninjav5_role_nginx_web_domain:
invoiceninjav5_role_nginx_web_subdomain
# Type: string
invoiceninjav5_role_nginx_web_subdomain:
invoiceninjav5_role_nginx_web_url
# Type: string
invoiceninjav5_role_nginx_web_url:
invoiceninjav5_role_paths_location
# Type: string
invoiceninjav5_role_paths_location:
invoiceninjav5_role_web_fqdn_override
# Override the Traefik fully qualified domain name (FQDN) for the container
# Type: list
invoiceninjav5_role_web_fqdn_override:

Example Override

invoiceninjav5_role_web_fqdn_override:
  - "{{ traefik_host }}"
  - "invoiceninjav52.{{ user.domain }}"
  - "invoiceninjav5.otherdomain.tld"

Note: Include {{ traefik_host }} to preserve the default FQDN alongside your custom entries

invoiceninjav5_role_web_host_override
# Override the Traefik web host configuration for the container
# Type: string
invoiceninjav5_role_web_host_override:

Example Override

invoiceninjav5_role_web_host_override: "Host(`{{ traefik_host }}`) || Host(`{{ 'invoiceninjav52.' + user.domain }}`)"

Note: Use {{ traefik_host }} to include the default host configuration in your custom rule

invoiceninjav5_role_web_http_port
# Type: string (quoted number)
invoiceninjav5_role_web_http_port:
invoiceninjav5_role_web_http_scheme
# Type: string ("http"/"https")
invoiceninjav5_role_web_http_scheme:
invoiceninjav5_role_web_http_serverstransport
# Type: dict/omit
invoiceninjav5_role_web_http_serverstransport:
invoiceninjav5_role_web_scheme
# URL scheme to use for web access to the container
# Type: string ("http"/"https")
invoiceninjav5_role_web_scheme:
invoiceninjav5_role_web_serverstransport
# Type: dict/omit
invoiceninjav5_role_web_serverstransport: