Master repository for the LedgerSMB project
PLpgSQL Perl HTML TeX Shell JavaScript Other
Latest commit d823b12 Jan 17, 2017 @ehuelsmann ehuelsmann * Update 1.5 Changelog
[skip ci]
Failed to load latest commit information.
.tx * Add transifex administration directory Dec 24, 2015
UI * Re #2264, resolve the 'memo size too big' part of GL and invoice entry Jan 14, 2017
bin add bin/.empty to retain bin/ Oct 21, 2016
conf * Fix #2534: Remove offending space Jan 14, 2017
dists * Now that 1.5 has branched, master is 1.6 Aug 20, 2016
doc * Update state diagram based on discussion with Chris Nov 27, 2016
lib * Fix #2545: Failure when creating AR/AP Aging report Jan 15, 2017
locale * Now that 1.5 has branched, master is 1.6 Aug 20, 2016
old * Fix 2550: Credit invoice indistinguishible from regular (edit screen) Jan 15, 2017
sql * Remove 'SECURITY DEFINER' as the function does nothing privileged Jan 16, 2017
t Fix typo in test documentation Jan 13, 2017
templates fixing small typo in check template, see #2027. Aug 7, 2016
tools * Refactor PSGI specifics out of starman.psgi into LedgerSMB::PSGI Dec 26, 2016
utils * Close #1828 by adding 'clean' and 'clean-libs' makefile targets Nov 12, 2016
xt move bin/ to old/bin/. Modify code to reflect the change. Oct 21, 2016
.gitattributes * Merge adjacent additions in sql/changes/LOADORDER instead of confli… Jan 1, 2017
.gitignore * Hide test output from git status Jun 24, 2016
.gitmodules * More submodule fixes May 17, 2016
.proverc * Adjust .proverc for the new library path Oct 20, 2016
.travis.yml Add Postgres 9.6 to tests Jan 13, 2017
CONTRIBUTORS minor change to contributors file Aug 18, 2016
COPYRIGHT Initial Import Sep 1, 2006
Changelog * Update 1.5 Changelog Jan 16, 2017
LICENSE Removing executable bit from documentation Mar 24, 2007
Makefile Add XLS feature requirements Dec 22, 2016 port changes to from the 1.5 release Dec 24, 2016
cpanfile * Remove middleware dependency, our use-case is too simple Jan 9, 2017


LedgerSMB - Small and Medium business accounting and ERP


LedgerSMB is a free integrated web application accounting system, featuring double entry accounting, budgetting, invoicing, quotations, projects, timecards, inventory management, shipping and more ...

The UI allows world-wide accessibility; with its data stored in the enterprise-strength PostgreSQL open source database system, the system is know to operate smoothly for businesses with thousands of transactions per week. Screens and customer visible output are defined in templates, allowing easy and fast customization. Supported output formats are PDF, CSV, HTML, ODF and more.

Directly send orders and invoices from the built-in e-mail function to your customers or RFQs (request for quotation) to your vendors with PDF attachments.

System requirements


  • Perl 5.10+
  • PostgreSQL 9.4+
  • Web server (e.g. nginx, Apache, lighttpd)

The web external server is only required for production installs; for evaluation purposes a simpler setup can be used, as detailed below.


A Dojo 1.10 compatible web browser is all that's required on the client (except IE8 and 9); it includes Chrome as of version 13, FireFox as of 3.6 and MS Internet Explorer as of version 10 and a wide range of mobile browsers.

Quick start

The instructions below are for getting started quickly; the project's site provides in-depth installation instructions for production installs.

Check out the sources from GitHub

Note: Skip this step for from-tarball installs Installation from release tarballs is preferred over installation from GitHub.

To get the latest development version:

 $ git clone
 $ cd LedgerSMB
 $ git submodule update --init --recursive

To get the released version 1.4.22, the commands look like:

 $ git clone -b 1.4.22
 $ cd LedgerSMB
 $ git submodule update --init --recursive

System (library) dependencies

The following non-Perl (system) dependencies need to be in place for the cpanm command mentioned below to work, in addition to what's documented on the How to install CPAN modules page on CPAN.

  • PostgreSQL client libraries
  • PostgreSQL server
  • DBD::Pg 3.4.2+ (so cpanm recognises that it won't need to compile it)
    This package is called libdbd-pg-perl in Debian and perl-DBD-Pg in RedHat/Fedora

Then, some of the features listed below have system requirements as well:

  • latex-pdf-ps depends on these binaries or libraries:
    • latex (usually provided through a texlive package)
    • pdflatex
    • dvitopdf
    • dvitops
    • pdftops
  • latex-pdf-images
    • ImageMagick

Perl module dependencies

This section depends on a working local::lib installation as well as an installed cpanm executable. Both should be available from your distribution's package repository (Debian calls them liblocal-lib-perl and cpanminus respectively). In case local::lib is installed from the the distro repository, step (4) in the installation instructions is still to be executed:

 $ echo 'eval "$(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)"' >>~/.bashrc

In order for the command above to take effect, please log out and log in again.

cpanm depends on the make command being available; depending on which dependencies are being installed, gcc may be required as well.

To install the Perl module dependencies, run:

 $ cpanm --quiet --notest --with-feature=starman [other features] --installdeps .

The following features may be selected by specifying --with-feature=<feature>:

Feature Description
latex-pdf-ps Enable PDF and PostScript output
latex-pdf-images Image size detection for PDF output
starman Starman Perl/PSGI webserver
openoffice document output
edi (EXPERIMENTAL) X12 EDI support
rest (EXPERIMENTAL) RESTful webservices

Note: The example command contains --with-feature=starman for the purpose of the quick start.

cpanm will by default use local::lib so that dependencies are not installed into the global perl installation.

The in-depth installation instructions contain a list of distribution provided packages to reduce the CPAN installation.


  1. For the pdf-ps target, LaTeX is required.
  2. For the pdf-images target, ImageMagick is required.

PostgreSQL configuration

While it's possible to use LedgerSMB with the standard postgres user, it's good practice to create a separate 'LedgerSMB database administrator':

$ sudo -u postgres createuser --no-superuser --createdb --login \
          --createrole --pwprompt lsmb_dbadmin
Enter password for new role: ****
Enter it again: ****

The pg_hba.conf file should have at least these lines in it (order of the entries matters):

local   all                            postgres                         peer
local   all                            all                              peer
host    all                            postgres     reject
host    all                            postgres        ::1/128          reject
host    postgres,template0,template1   lsmb_dbadmin     md5
host    postgres,template0,template1   lsmb_dbadmin    ::1/128          md5
host    postgres,template0,template1   all        reject
host    postgres,template0,template1   all             ::1/128          reject
host    all                            all        md5
host    all                            all             ::1/128          md5

Note: pg_hba.conf can be found in /etc/postgresql/<version>/main/ on Debian and in /var/lib/pgsql/data/ on RedHat/Fedora

After editing the pg_hba.conf file, reload the PostgreSQL server (or without 'sudo' by running the commands as root user):

 $ sudo service postgresql reload
 # -or-
 $ sudo /etc/init.d/postgresql reload

Configure LedgerSMB

For most systems, all that's required in this step is:

 $ cp conf/ledgersmb.conf.unbuilt-dojo ledgersmb.conf

Note: Using 'built dojo' instead of 'unbuilt dojo' will greatly improve page load times of some pages. However, creating a built dojo adds considerable complexity to these instructions; please consult the extensive setup instructions to build dojo.

Running Starman

With the above steps completed, the system is ready to run the web server:

NOTE: DO NOT run starman (or any web service) as root, this is considered a serious security issue, and as such LedgerSMB doesn't support it. Instead, if you need to start LedgerSMB from a root process, drop privlidges to a user that doesn't have write access to the LedgerSMB Directories first. Most daemonising mechanisims (eg: systemd) provide a mechanism to do this. Do not use the starman --user= mechanism, it currently drops privlidges too late.

 $ starman -I lib -I old/lib --listen localhost:5762 tools/starman.psgi
2016/05/12-02:14:57 Starman::Server (type Net::Server::PreFork) starting! pid(xxxx)
Resolved [*]:5762 to [::]:5762, IPv6
Not including resolved host [] IPv4 because it will be handled by [::] IPv6
Binding to TCP port 5762 on host :: with IPv6
Setting gid to "1000 1000 24 25 27 29 30 44 46 108 111 121 1000"

Environment Variables

We support the following

  • PERL5LIB : Required for most installations (if local::lib has been used)
  • LSMB_WORKINGDIR : Optional
    • Causes a chdir to the specified directory as the first thing done in starman.psgi
    • If not set the current dir is used.
    • An example would be

Next steps

The system is installed and should be available for evaluation through

  • http://localhost:5762/ # creation and privileged management of company databases
  • http://localhost:5762/ # Normal login for the application

The system is ready for preparation for first use.

Project information

Web site:

Live chat:


Mailing list archives:

Mailing lists:


Project contributors

Source code contributors can be found in the project's Git commit history as well as in the CONTRIBUTORS file in the repository root.

Translation contributions can be found in the project's Git commit history as well as in the Transifex project Timeline.


Copyright (c) 2006 - 2016 The LedgerSMB Project contributors
Copyright (c) 1999 - 2006 DWS Systems Inc (under the name SQL Ledger)