Installation

January 24, 2026 · View on GitHub

SQL-Ledger Documentation ▶ Installation

Installation

This document explains how to install the SQL-Ledger program code. As detailed in the Quick Start, this is only the first step required to achieve a fully operational system.

GitHub Repository

It is always recommended to install the program via Git, either through the Ansible role or a manual installation. Both approaches are described below. Downloading and extracting archive files introduces unnecessary complications during upgrades.

The GitHub repository is structured as follows:

BranchContent
maindefaultVersion 4
fullextended Version 3 by Tekki
dwsDWS Version 3
betadevelopment of Version 4

main is the default branch and contains version 4. beta is used for development and contains the planned changes for the next release. It's history may get modified, fast forwarding of a local copy is therefore not guaranteed.

The repository has version tags that allow to download a specific version back to 2.6.0 from October 1, 2005.

Requirements

SQL-Ledger Version 4 requires

  • Perl 5.40 or higher
  • PostgreSQL 17 or highter

Version 3 runs on older systems too.

Ansible Role

The recommended installation method is to use the Ansible role. It will install and configure SQL-Ledger on a preinstalled Debian 13 Trixie.

Manual Installation

For a manual installation, the procedure is:

  • generate the locales
  • install Git, Perl, PostgreSQL database and Apache web server
  • install the Perl modules
  • clone the SQL-Ledger repository
  • set the file access permissions
  • configure the web server

The Perl modules required for a complete installation are:

ModuleDebian package
Archive::Extractlibarchive-extract-perl
Archive::Ziplibarchive-zip-perl
DBD::Mocklibdbd-mock-perl
DBD::Pglibdbd-pg-perl
Excel::Writer::XLSXlibexcel-writer-xlsx-perl
HTML::Formlibhtml-form-perl
IO::Socket::SSLlibio-socket-ssl-perl
Image::Magicklibimage-magick-perl
Imager::zxing-
Mojoliciouslibmojolicious-perl
Print::Colored-
Spreadsheet::ParseXLSXlibspreadsheet-parsexlsx-perl
Templatelibtemplate-perl
Text::QRCodelibtext-qrcode-perl
Tie::IxHashlibtie-ixhash-perl
YAML::PPlibyaml-pp-perl

On a simple system, you should at least install Archive::Zip, DBD::Pg, and Excel::Writer::XLSX. HTML::Form and DBD::Mock are only used in tests and Template only in the script that generates templates. If you're not planning to import QR Bills, you don't need Image::Magick and Imager::zxing.

Always clone the repository using git, don't download and extract the code from an archive file.

For more details, take a closer look at the Ansible role and the files related to the Docker images.

Virtualization

There are several reasons why production SQL-Ledger is not suitable to be run in a Docker container. Use either a dedicated server, a virtual machine, or a LXC.

For tests or development on the other hand, Docker is a convenient solution. There are two Docker files and corresponding compose scripts available in directory docker:

  • Dockerfile and docker-compose.yml for Debian Trixie
  • DockerfileAlma and docker-compose-alma for AlmaLinux 9

They create a simple test and development environment that doesn't include a LaTeX environment to create PDF files.

To start the Debian container, use the shell commands

cd docker
docker compose -p sql-ledger up -d

or for AlmaLinux

cd docker
docker compose -f docker-compose-alma.yml -p sql-ledger up -d

This will set up a system with 4 containers, one for SQL-Ledger, one for PostgreSQL, and another two for the database management tools Adminer and pgAdmin.

Access these services from your local browser

To connect to the database, you have to use hostname db with username and password sql-ledger.