Minimal system requirements for running a server with BGERP + MySQL are as follows:

  • An RPM-based Linux operating system, preferably CentOS or RHEL (used by samples), is recommended.

  • CPU core equal to Intel x86 500MHz; 1GHz recommended;

  • 512MB RAM; 1GB recommended.

Мы рекомендуем вам установку в Docker контейнер, как наиболее простой способ запустить систему для изучения. В дальнейшем данные могут быть перенесены на Linux сервер для полноценной эксплуатации.


Installation from a Docker image.

The Docker image uses approximately 1 GB of disk space and contains the latest published build will all the required components: MySQL, Java. The actual Demo state is also applied during first run.

This variant perfectly fits the following purposes:

  • Having a first look and playing with the program;

  • Running on Windows machines;

  • Running in a different environment, e.g. with an already installed MySQL but with a different/untested version.

Use the following command to remove container - use it also before updating:

docker rm -f bgerp

The running container is available via web-interface. Use NGINX for restricting access from an outside network.

Data volumes Inside the Container (Win and *NIX)

In this case all the required data volumes are hidden inside Docker container.

All the related data is removed together with container upon deletion.
docker pull bgerp/bgerp && docker run -d --name bgerp --restart unless-stopped -p 9088:9088 bgerp/bgerp && docker logs --follow bgerp

Data volumes Outside the Container (*NIX only)

docker pull bgerp/bgerp && docker run -d --name bgerp --restart unless-stopped \
    -v /srv/bgerp/data/mysql:/var/lib/mysql \
    -v /srv/bgerp/data/filestorage:/opt/bgerp/filestorage \
    -v /srv/bgerp/data/backup:/opt/bgerp/backup \
    -v /srv/bgerp/conf:/opt/bgerp/conf \
    -v /srv/bgerp/log:/opt/bgerp/log \
    -p 9088:9088 \
    bgerp/bgerp && docker logs --follow bgerp
Completely remove all the related data.
rm -rf /srv/bgerp

Deployment Script

Distribution provides a Bash script that runs on Debian/CentOS and performs the following actions:

  • Deploys a Docker container with a running instance pf BGERP;

  • Configures NGINX reverse proxy with an SSL access.


  • The following packages have to be pre-installed: docker-ce, nginx, certbot, curl.

  • Script needs to be executed via sudo or root

Execution Steps: Step 1. Switch to a working directory, e.g:

cd /tmp

Step 2. Download the script using curl:

curl --output

Step 3. Execute the script:

sudo bash <NAME> <PORT>


  • <NAME> - DNS server name used for the instance;

  • <PORT> - HTTP port exposed on the localhost.


sudo bash 9001


Installation on a Linux server.


The Original MySQL DB Server version 8.0 or newer has to be used for installation.

Different forks of MySQL (Maria, Percona) do not fit because of missing fulltext index support. Below is the test query you can use to verify compatibility:

// PzdcDoc snippet of: 'src/ru/bgcrm/plugin/fulltext/db.sql', lines: 1 - 9

        object_type VARCHAR(100) NOT NULL,
        object_id INT NOT NULL,
        scheduled_dt DATETIME,
        data TEXT NOT NULL,
        FULLTEXT (data) WITH PARSER ngram,
        KEY scheduled_dt (scheduled_dt),
        UNIQUE KEY type_id (object_type, object_id)

You can use the instruction for converting existing MySQL-like DB to the supported version.


Once installed, check the mandatory options below in [mysqld] section in my.cnf file:

sql-mode must be set exactly to an empty string, as shown in the example above. Add this line if sql-mode option is not defined. In case this string is still missing, DB creation script will take care of correcting and adding it.

Optionally you can disable mysqlx protocol:


And restrict access to database server from different hosts, if you don’t need that:


Some additional optimization options, you may need in the future. Please, check their intentions before.


You will also need a root access to the MySQL Server at the time of installation (one time action).


OpenJDK 21 version is required - is can be installed differently for distributions, as in the example below:

sudo yum update
sudo yum install -y java-21-openjdk-devel
Confirm that both java and javac commands are available after installation.


All the operations require a root user.

Step 1. Check and install script dependencies:

sudo yum update
sudo yum install -y epel-release
sudo yum install -y zip pwgen wget mysql-community-client unzip

Step 2. Download archive and unpack it:

wget -O /tmp/ &&
unzip /tmp/ -d /opt &&
chmod 744 /opt/bgerp/*.sh

Step 3. Generate DB password ant add it into files:

ERP_DB_PWD=`pwgen -y -c 20` && export EPR_DB_PWD &&
echo "Setting DB password: '$ERP_DB_PWD'" &&
sed -i "s/GENERATED_PASSWORD/$ERP_DB_PWD/" /opt/bgerp/ &&
sed -i "s/GENERATED_PASSWORD/'$ERP_DB_PWD'/" /opt/bgerp/db_create.sql

Step 4. Run a DB script to create DB structure:

mysql --default-character-set=utf8 -h127.0.0.1 -uroot -p < /opt/bgerp/db_create.sql
mysql --default-character-set=utf8 -h127.0.0.1 -ubgerp -p$ERP_DB_PWD bgerp < /opt/bgerp/db_init.sql

Step 5. Optionally apply data from the Demo:

wget -O /opt/bgerp/bgerp.sql
mysql --default-character-set=utf8 -h127.0.0.1 -uroot -p bgerp < /opt/bgerp/bgerp.sql && rm /opt/bgerp/bgerp.sql
wget -O /opt/bgerp/
unzip -d /opt/bgerp/filestorage && rm /opt/bgerp/

Step 6. If required, adapt the following values in in DB server host value, HTTP and management ports.

Step 7. If required, adapt JAVA_HOME variable in a :

if [ -z "$JAVA_HOME" ]; then
    echo "The JAVA_HOME environment variable is not defined"
    echo "This environment variable is needed to run this program"
    exit 1

java and javac will be expected in $JAVA_HOME/bin/

Step 8. Use for application start and termination. will show the current status of the application. Upon starting, check log/bgerp.log and log/bgerp.out for errors.

Once running, application will be available via Web-interface.


In order to enable application auto-start upon the system start, use a systemd script. Systemd script is located in scripts/bgerp.service - copy it to /etc/systemd/system/ and then execute the following commands:

systemctl daemon-reload
systemctl enable bgerp


Typically the application is running in Intranet, access to restricted interfaces from outside as well as SSL may be organized using NGINX.


The application is runnuning on internal host Outside on host is available only open interface The configuration may be typically placed in file /etc/nginx/conf.d/

server {
    server_name   ;
    server_name   ;
    access_log              /var/log/nginx/;

    # optionally close access without interface
    #location = / {
    #    return 404;

    # for opening user interface - add admin||user
    # for opening user mobile interface - add usermob
    location / {
        client_max_body_size    100m;
        proxy_pass    ;
        proxy_redirect          http:// https://;
        proxy_set_header        Host $host;
        proxy_set_header        Connection close;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_read_timeout      300;
        gzip_proxied            any;

    # this part has to be generated first by CertBot:
    # certbot --nginx -d -d
    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

# redirect HTTP to HTTPS
server {
    listen        80;
    listen        [::]:80;
    return 301    https://$host$request_uri;

Multiple Instances

In the case when you need to setup multiple app instances on a single server, recommendations is the following:

  • create a separated Linux user for the instance, for example inst;

  • place the app to the user’s home, /home/inst/bgerp;

  • name the database as bgerp_inst;

  • adjust server.port.http and server.port.admin by adding numeric prefixes, for the second server’s instance it would be 19088 and 12011 respectively;

  • for running the instance on server start instead of SystemD use cron:

crontab -e
# to the opened editor add record
@reboot /home/inst/bgerp/



Система версионирования продукта описана на нашем веб-сайте. Следуя данному руководству, вы установите его актуальный Stable Release. При последующей эксплуатации рекомендуется обновляться только при выпуске очередного подобного релиза, о чём приложение информирует уведомлением в интерфейсе.

Prior to updating, make sure to examine Release Notes, as these may contain important information or update instructions.

Однако в момент первоначального запуска системы предпочтительно использовать Pre-Stable Release для получения наиболее свежей функциональности.


You can use Admin / Application / Status tool to retrieve application’s current version and the list of release notes. All operations are implicitly using console utility described below.

install app status

Update section - triggers update to the latest application version. that includes all required libraries. The following command is executed:

./ && ./ update(f) && ./

Update on change section - uploads a change package based on the process code. The following command is executed:

./ && ./ install && ./

Executing Update after Update on change operation will bring application server to a latest Stable Release state.


Перед установкой обновления всегда делайте резервную копию программы при помощи скрипта

  • При указании параметра db скрипт создаст резервную копию БД, данные для подключения к серверу MySQL берутся из файла

  • Резервные копии сохраняются в папке backup в файлах с форматом имени год-месяц-дата-время(.db).zip, наличие подстроки db означает, что в архиве есть дамп БД

Для обновления вызовите команду:

./ update

Для обновления системы на иную версию (не 3.0) вызовите команду:

./ update <version>


./ update 3.0

Running without arguments prints the help.

Commands for installer:
        update            - update to the actual builds if they differ from currents.
        updatef           - update to the actual builds without comparison.
        update <version>  - switch to another version (not build) of the program.
        killhash          - clear executed queries history.
        install <zip>     - install a module from the zip file.
        installc <change> - download update files from <change> and install them.

Recommended command for updating (argument 'db' can be excluded for speeding up and used only periodically):

./ db && ./ update && ./

Update files are taken from version-containing URL, for example for version 3.0:


After performing an update created a log file log/update_yyyy-MM-dd_HH:mm:ss.log that has to be checked on errors after that. For example there might be the DB permission issue.

04-07/19:53:25 ERROR [main] ExecuteSQL - Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation

It has to be fixed using the queries to MySQL executed with root user.

GRANT ALTER ROUTINE ON bgerp.* TO 'bgerp'@'%';
GRANT ALL PRIVILEGES ON bgerp.* TO 'bgerp'@'%';

Query History

For all the executed during update process SQL queries their hashes are stored in DB table db_update_log. This allows to prevent their re-execution. If you need to clear the history, use the command:

./ killhash

Demo System

The Demo System is running on with the latest Pre-Stable Release of software and resets to initial state every 3rd hour. Поскольку в системе приведены примеры всего функционала продукта, она может использоваться для изучения программы с проверкой конфигураций. В случае длительных экспериментов для избежания потери сделанных изменений мы рекомендуем вам использовать Docker Container. Более подробное описание Demo System доступно в Workflow.