Skip to content
Maikel Dollé edited this page Jan 6, 2021 · 6 revisions

Generate an application key

Before starting Invoice Ninja via Docker make sure you generate a valid application key. If you are not sure what an application key is, please visit this blog post.

To generate an application just run

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

This will generate an application key for you which you need later. The generated key has the following format: base64:NdRTYZSVE4+062um1CNRscNg9TXFuL22Sb63SwLcqtY= - yes, the base64: belongs to the key!

Create folders for data persistence

To make your data persistent, you have to mount public and storage from your host to your containers.

  1. Create two folder on your host, e. g. /var/invoiceninja/public and /var/invoiceninja/storage
  2. Mount these folders into your container - see docker-compose.yml

You can create these folders wherever you want on your host system.

⚠️ When using host mounted folder for persistence, make sure they are owned by the proper user and group. As we run Invoice Ninja without root , we use a separate user, the folders on the host system need to be owned by uid 1000 and a gid 82 (www-data group).

Run this on your host system

chown -R 1500:82 /var/invoiceninja/public /var/invoiceninja/storage

to apply the proper permission to the folders. This also applies to the docker-compose setup when using bind-mounted host directories.

PhantomJS key

The PhantomJS key is set to a-demo-key-with-low-quota-per-ip-address. This demo key is limited to 100 requests per day.

To set a different key add -e PHANTOMJS_CLOUD_KEY='<YOUR PHANTOMJS KEY>' to the 'docker run' command.

Alternatively, you may add PHANTOMJS_CLOUD_KEY= '<YOUR PHANTOMJS KEY>' under the "environment" for invoiceninja to your docker-compose.yml file.

For further configuration and troubleshooting regarding PhantomJS and Invoice Ninja see documentation here.