Documentation
Install using Docker

Install Using Docker

But wait... What is Docker?

Docker containers isolate the app from the host system and solve the "it works on my machine" headache. With this method, everyone using Docker runs virtually the same environment as the others. This is a great way to ensure that everyone has the same environment, thus making it less likely to have problems.

Docker also lets you run multiple containers on the same machine with different configurations. To learn more about containers, we strongly advise you to read Docker's explanation (opens in a new tab) first.

Prerequisites

Before going further, please make sure you have the Docker Engine installed. To install the Docker Engine, visit Docker's installation page (opens in a new tab) and follow the instructions for your platform.

Instructions

Our official Docker image can be used standalone or as part of a composition. The choice of which to use depends upon your needs and use-case.

As a general rule, if you are looking to run a simple FOSSBilling container that will connect to an external database, a standalone installation may be suitable. However, if you are looking for a ready-to-use environment, using Docker Compose may be more appropriate.

These instructions use the latest image, which is the latest stable version of FOSSBilling. This can be changed to preview for preview versions, or to a specific version number, if required.

This is an example of simply running the latest FOSSBilling image with a volume named fossbilling where changes will be persisted:

docker run -d -p 80:80 -v=fossbilling:/var/www/html --restart=always fossbilling/fossbilling:latest

Once the container has started, you can access the FOSSBilling web installer by visiting your server IP/hostname in a web browser. Using this method, you will require an external database and the details of this should be used in the installer.

Post-installation

⚠️

If the cron job is not configured, then FOSSBilling will not operate correctly.

Regardless of the installation method used, after completing the installation, you still need to configure a cron job to ensure scheduled tasks are run. This can be achieved using the command below on the host system (replacing <container name/id> with the container name/ID as appropriate):

(crontab -l; echo "*/5 * * * * docker exec <container name/id> su www-data -s /usr/local/bin/php /var/www/html/cron.php")|awk '!x[$0]++'|crontab -

If you do not know the container name or ID for the above, you can get a list of containers with docker ps.