IX Appendices

Appendix C Installation

LedgerSMB can be installed on almost any Linux host including Raspberry Pi. The project uses Debian for its docker images and Continuous Integration (CI) testing.

The following installation methods are available:

  1. 1.

    Docker Preview - The recommended way to quickly run and evaluate LedgerSMB. This method is not suitable for internet facing installations.

  2. 2.

    Docker Production - A more secure installation suitable as a base for internet facing use.

  3. 3.

    Native - A more complex installation that requires detailed knowledge of the underlying operation system. The project does NOT recommend this installation method.

  4. 4.

    Docker Development - Used by developers and includes extra libraries and code. Not recommended unless developing code for LSMB.

  5. 5.

    Linux Distribution - Some distributions have old versions of LedgerSMB. With recent LSMB improvements, the LSMB project no longer fits into the distribution’s guidelines. The consequence is that distributions are no longer updated or maintained. The project does not recommend using LSMB from any Linux distribution.

C.0.1 Docker preview

The advantage of using docker preview is that all prerequisites are determined and loaded automatically. This is the quickest way to preview LedgerSMB.

This method should NOT be used to install LSMB in a manner that allows internet wide connections.

On Ubuntu 22.04 use the following commands:

# Install docker compose
sudo apt install docker-compose
# Make sure user is in the docker group
sudo usermod -a -G docker $USER
# Get the latest version of LSMB 1.11
wget https://raw.githubusercontent.com/ledgersmb/ledgersmb-docker/1.11/docker-compose.yml
# Update the group credentials
exec su -l $USER
# Start the container not using sudo
docker-compose up -d

For the authoritative installation source see https://github.com/ledgersmb/LedgerSMB/blob/master/README.md

C.0.2 Docker Production

C.0.3 Native

LedgerSMB provides installation tarballs for installing LSMB into the native file system. This installation method requires experience and detailed knowledge of both the Linux operating system and LedgerSMB. Experience has shown that getting prerequisites and security correct is sometimes a significant challenge.

The following commands were tested on a clean, default, server install with no snaps using ubuntu-22.04.3-live-server-amd64.iso.

The steps were extracted from the docker install at https://github.com/ledgersmb/ledgersmb-docker/blob/1.11/Dockerfile. This docker file should be considered the authoritative source.

Warning

The following commands need to be modified for proper security, which is the responsibility of the installer.

Make sure Ubuntu is up to date:

sudo apt update
sudo apt -y upgrade
sudo reboot

Install the prerequisites:

#!/bin/bash
#
# The following commands show an example of the commands
# that may be used for a native install.
#
# They have a number of shortcomings that an experienced
# Linux administrator should recognize and correct.
#
# For example, PostgreSQL is, by default, installed
# and running as a superuser and should not be.
#
set -e   # stop on error
set -x   # echo commands
sudo apt-get -y install \
  cpanminus \
  make \
  gcc \
  libperl-dev \
  wget ca-certificates \
  gnupg \
  iproute2 \
  libclass-c3-xs-perl \
  texlive-plain-generic \
  texlive-latex-recommended \
  texlive-fonts-recommended \
  texlive-xetex fonts-liberation \
  lsb-release \
  dh-make-perl \
  libmodule-cpanfile-perl \
  git \
  wget
sudo apt-file update
# Another viable location is /usr/local/ledgersmb/
export INSTALL_LOCATION="/srv"
export LSMB_VERSION="1.11.8"
export LSMB_DL_DIR="Releases"
export ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
wget --quiet -O /tmp/ledgersmb-$LSMB_VERSION.tar.gz \
    "$ARTIFACT_LOCATION"
sudo tar -xzf /tmp/ledgersmb-$LSMB_VERSION.tar.gz \
    --directory "$INSTALL_LOCATION"
rm -f /tmp/ledgersmb-$LSMB_VERSION.tar.gz
cd ${INSTALL_LOCATION}/ledgersmb
gather () {
for lib in $(cpanfile-dump --with-all-features --recommends --no-configure --no-build --no-test)
  do
    if dh-make-perl locate "$lib" 2>/dev/null ;
    then
      :
    else
      echo no : $lib ;
    fi ;
  done
}
gather | grep -v dh-make-perl | \
    grep -v ’not found’ | \
    grep -vi ’is in Perl  | \
    cut -d  -f4 | \
    sort | \
    uniq | \
    sudo tee ${INSTALL_LOCATION}/derived-deps
sudo apt-get -y install $(cat ${INSTALL_LOCATION}/derived-deps)
sudo cpanm --quiet --notest \
    --with-feature=starman \
    --with-feature=latex-pdf-ps \
    --installdeps ${INSTALL_LOCATION}/ledgersmb/
# Postgres
# From https://www.postgresql.org/download/linux/ubuntu/
sudo sh \
    -c ’echo "deb https://apt.postgresql.org/pub/repos/apt \
    $(lsb_release -cs)-pgdg main" \
    > /etc/apt/sources.list.d/pgdg.list’
wget --quiet -O \
    - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
    sudo apt-key add -
sudo apt-get -y update
# Warning: Actually using the default PG install is NOT best practice.
sudo apt-get -y install postgresql
# Optional clean up
# sudo apt-get purge -y git cpanminus \
#     make gcc libperl-dev
# sudo apt-get autoremove -y
# sudo apt-get clean

Once all of the prerequisites have been installed the user can proceed by following the install instructions on the web site. For example, https://ledgersmb.org/content/installing-ledgersmb-111, starting at ”Configuring the PostgreSQL server”

C.0.4 Docker Development

C.0.5 Linux Distribution

This method of installation is not recommended. These old distributions only exist to support existing users that have not yet upgraded.