Hosting invoice ninja via docker

Invoice ninja is an open source invoicing system, five years ago I switch to it because my hosting company allow me to install it via cPanel package manager, but recently my hosting switch the backend management tool, invoice ninja no longer available, and invoice ninja do have a major update from version 4 to version 5, so I have to find a solution now.

Thanks to docker, now its fairly simple to install and run invoiceninja on my own server, currently I am running it on my Synology DS720+

First you need to install docker through the package manager.

And then you need to enable SSH for command line access.

You need to install the Git server package as well.

Then login to the system using SSH

In windows you can use Putty

In Mac OS or Linux, just open up terminal, SSH already installed by default

to login to the DSM via the following command line.

ssh user@server_ip

After you login, navigate to this folder

cd /volume1/docker

then create a folder for invoiceninja

mkdir invoiceninja && cd invoiceninja

git clone https://github.com/invoiceninja/dockerfiles.git .

then edit the docker-compose file and env file to suit your environment.

  1. Edit the nginx port to your server available port

then for the env file

Generate an APP_KEY first
docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show

and then change permission the the following folder

chmod 755 docker/app/public
sudo chown -R 1500:1500 docker/app
# IN application vars
##############################
# APP_URL should be match to your server and the port you open for the
# nginx web server on the docker-compose file
##############################
APP_URL=http://192.168.0.5:8888  
APP_KEY=<the APP_KEY generate via the docker run>
APP_DEBUG=false # switch to debug mode to false

then you can run the following command to spin up the stacks.

docker-compose up -d

then you should be able to access the invoiceninja web interface via

http://server_ip:port
http://192.168.0.5:8888

Conclusion

since this build is use docker, this mean you can host this application stack on any server that run docker.