Setting up CSBill

CSBill is an open-source billing and invoicing application that allows you to manage clients, contacts, quotes, invoices and receive online payments.

There are multiple ways of installing and running CSBill, but the easiest is using Docker and the official Docker image.

Getting Started

System Requirements:

In order to run CSBill, you need the following:

  • PHP >= 5.6.10
  • MySQL > 5.5.0 (Only MySQL is supported at the moment)
  • a WebServer (Nginx and Apache supported)

Although CSBill can work on any Operating System that meets the above requirements, this tutorial will assume a Linux environment. The instructions can easily be adapted to work on Windows or MacOS.

If you do not have any of the above requirements on your computer or server, then you can opt to using Docker instead (instructions below).

The first step is to create a directory where you want to install the application

$ mkdir /var/www/html/csbill

Then download the latest version (for this tutorial, we’ll work with the Zip file) and extract the files to the directory you created earlier

$ unzip CSBill-x.x.x.zip

This should give you the full directory structure of the application.

The next steps is to set up your WebServer configuration. Below are sample configuration files that you can use, but it might need to be tweaked depending on your environment and Operating System.

Nginx Configuration

Note: The configuration might be different depending on the OS you are using on your server. For specific details on setting up NginX on your OS, please view the respective documentation for your operating system.

server {
server_name yourdomain.com www.yourdomain.com;
root /var/www/html/csbill/web;

location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}

location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}

error_log /var/log/nginx/csbill_error.log;
access_log /var/log/nginx/csbill_access.log;
}

Apache Configuration

Note: The configuration might be different depending on the OS you are using on your server. For specific details on setting up Apache on your OS, please view the respective documentation for your operating system.

<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com

DocumentRoot /var/www/html/csbill/web
<Directory /var/www/html/csbill/web>
# enable the .htaccess rewrites
AllowOverride All
Order allow,deny
Allow from All
</Directory>

ErrorLog /var/log/apache2/csbill.error.log
CustomLog /var/log/apache2/csbill.access.log combined
</VirtualHost>

Final Steps

The final steps is to open up a web browser, and navigate to your domain name. This should open up the installation page, where you can then start installing and setting up your application.


Installing using Docker

CSBill has an official repository for running on Docker.

The Docker image does not come with MySQL pre-installed, so you would need to run a MySQL instance in a separate container.

To run MySQL, follow the instructions on the official MySQL or MariaDB repositories.

Pull the latest version of CSBill using the below command

docker pull csbill/csbill:latest

The next step is to run the container. You also need to link the database container to the application container

docker run -d — name csbill — link db:db csbill/csbill

This will generate a random port on which CSBill wil run. If you want to use a specific port, you can pass the `-p <port>:80` value with the specific port number that you can use. CSBill should now be available on ‘localhost:<port>’.