Installing latest LedgerSMB using Docker Compose

Submitted by ehu on

By far the fastest procedure for installing LedgerSMB is by using the published Docker images: Being an ERP, there are many dependencies to be installed and all of them are included in the images, with the exception of the required PostgreSQL database. There are two ways to provide the PostgreSQL functionality: by setting up a separate PostgreSQL server or by using a PostgreSQL-providing Docker container.

This article describes the latter option to use a second Docker container to provide the PostgreSQL server. The instructions below assume installed Docker and Docker Compose. Many tutorials to install them float around on the web; e.g. these instructions from DigitalOcean to install docker-compose.

  1. git clone https://github.com/ledgersmb/ledgersmb-docker.git
    This checks out the docker-compose file which will install the latest production version; if you want to use an older version, e.g. 1.6, add the -b <version> option:
    git clone -b 1.6 https://github.com/ledgersmb/ledgersmb-docker.git
  2. cd ledgersmb-docker
  3. docker-compose pull
  4. docker-compose up -d
    Note that the "-d" is important: it starts the containers in the background; without it, the containers' logs will be shown in the terminal. They can be terminated with Ctrl-C, but that also terminates the containers

    After the steps above, LedgerSMB should be available on http://127.0.0.1:5762/
  5. apt-get install apache2 certbot python-certbot-apache
  6. certbot certonly  --apache -d example.com -d www.example.com
  7. grab the <site>.conf from the LedgerSMB code repository and edit it:
    1. curl https://raw.githubusercontent.com/ledgersmb/LedgerSMB/master/doc/conf/webserver/apache-vhost.conf -o /etc/apache2/sites-available/ledgersmb.conf
    2. nano /etc/apache2/sites-available/ledgersmb.conf:
      1. Replace YOUR_SERVER_NAME with your server name; e.g. "example.com"
      2. Replace SSL_CERT_FILE, SSL_KEY_FILE, and SSL_CHAIN_FILE with the corresponding files in /etc/letsencrypt/live
      3. Replace http://localhost:5762 with http://127.0.0.1:5762
        When your server has IPv6 enabled, the former will resolve to ::1, on which the container created above, isn't available
      4. Finally, remove the DocumentRoot line with WORKING_DIR
  8. a2ensite ledgersmb
  9. a2enmod ssl rewrite proxy proxy_http
  10. systemctl restart apache2

 

 

Topic
Release