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.
- 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
- cd ledgersmb-docker
- docker-compose pull
- 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/
- apt-get install apache2 certbot python-certbot-apache
- certbot certonly --apache -d example.com -d www.example.com
- grab the <site>.conf from the LedgerSMB code repository and edit it:
- curl https://raw.githubusercontent.com/ledgersmb/LedgerSMB/master/doc/conf/apache-vhost.conf -o /etc/apache2/sites-available/ledgersmb.conf
- nano /etc/apache2/sites-available/ledgersmb.conf:
- Replace YOUR_SERVER_NAME with your server name; e.g. "example.com"
- Replace SSL_CERT_FILE, SSL_KEY_FILE, and SSL_CHAIN_FILE with the corresponding files in /etc/letsencrypt/live
- 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
- Finally, remove the DocumentRoot line with WORKING_DIR
- a2ensite ledgersmb
- a2enmod ssl rewrite proxy proxy_http
- systemctl restart apache2