by Vasily Sidorov, Aug-24, 2022
In this article we describe installation of Firebird versions 3 and 4 on the popular Linux versions: CentOS 7, Oracle Linux 7/8, Debian 9/10, Ubuntu18/20 and OpenSUSE15.0.
In order to get Firebird distribution for Linux, please use tar archive from the official Firebird web site:
We assume that installation is done either with root or with sudoer, and that Linux computer has Internet access.
Please note that some commands require input from the user. Please note that lines with semicolon (;) at the end mean that command can be run as a single-line command.
Also, we recommend reading of Release Notes for the version of Firebird which you intend to install.
Depending on the distribution, ncurses5 will be system library (RH7/Debian) or available as a package for backward compatibility (RH8/Debian).
Library tommath will be with version 0 or version 1 (they are binary compatible). If there is no tommath0, we will create symlink.
Other necessary system tools are tar and curl.
We install these packages explicitly so package manager will mark them as manually controlled and did not uninstall them automatically.
vm.max_map_count = 256000then apply
sysctl -p /etc/sysctl.conf
yum install epel-release;
For CentOS 8
dnf install epel-release;
For Oracle Linux 7
yum install oracle-epel-release-el7;
For Oracle Linux 8
dnf install oracle-epel-release-el8;
For other distributions the necessary packages should be available in the main repositories.
CentOS 7 / Oracle Linux 7
yum makecache; yum install ncurses libicu libtommath; yum install curl tar;
CentOS 8 / Oracle Linux 8
dnf makecache; dnf install ncurses-compat-libs libicu libtommath; dnf install curl tar;
Debian 9/10, Ubuntu 18/20
apt-get install libncurses5 libtommath1; apt-get install curl tar;
Open SUSE 15
zypper install libncurses5 libtommath1; zypper install curl tar;
Version of ICU can vary:
Debian 9
apt-get install libicu57
Debian 10
apt-get install libicu63
Ubuntu 18
apt-get install libicu60
Ubuntu 20
apt-get install libicu66
OpenSUSE 15.0
zypper install libicu60_2
In the distributions which have libtommath1 (all above except CentOS7 and Oracle Linux 7) it is necessary to create symlink libtommath.so.0:
TM=libtommath.so; for LIB in `find /lib* /usr/lib* -name ${TM}.1`; do ln -s ${TM}.1 `dirname ${LIB}`/${TM}.0; done; unset TM;
Installation script of Firebird 4.0.1 and upper can create symlink automatically, but for Firebird 3 it should be created manually.
We assume that DOWNLOADLINK is a link from www.firebirdsql.org to download necessary Firebird.
curl -L DOWNLOADLINK | tar -zxC /tmp cd /tmp/FIREBIRD_folder sudo ./install.shHere DOWNLOADLINK - link to tar.gz, and FIREBIRD_folder - Firebird-version.build-0.architecture
where distribution will be unpack by the command tar -zxC /tmp
That’s all needed for the quick installation of Firebird 3 or 4 on Linux.
Optionally, you can generate the optimal configuration files (firebird.conf and databases.conf) with Firebird Configuration Calculator.
Memory fragmentation limit is controlled by the parameter vm.max_map_count, which by default has value 65536.
In order to keep this setting after the reboot of the server, add the following line to /etc/sysctl.conf
vm.max_map_count = 256000To apply it, either reboot server or run command:
sudo sysctl -p /etc/sysctl.conf
By default, on Linux sorting files and files with data for global temporary tables are situated in /tmp, files for mon$ data and lock tables are in /tmp/firebird.
How to determine the proper size for the partition with temp files?
Potentially, sorting and blob files can be rather large, so practical recommendation to have partition for temp files for the production system with decent number of users around 30-40Gb. To determine the proper size more precisely, we recommend to watch for the actual sizes of temp files.
The small problem for such monitoring that sorting files are unlinked immediately after the creation, so it is not possible to see them with usual “ls” command. To view them, we need to check handles for the process (and they will be marked as deleted) with the following command:
sudo ls -lhF /proc/`pgrep firebird`/fdAs a result of this command, we will see contents of pseuvdo-folder /proc/.../fd/
To see the information about the specific file in this folder, need to use command:
sudo stat -L /proc/`pgrep firebird`/fd/NNNNNwhere NNNNN is the descriptor of the file.
You can use this command for SuperServer and SuperClassic architectures, when engine runs as a single process. Of course, instead of pgrep firebird it is possible to specify handle number of Firebird process.
Also, in order to perform restores, on the partition with backups we recommend to have additional free space, equal to the largest database size.
It also means that database files and folders where databases and backups are located should have ownership or permissions for this user.
Sometimes it makes sense to create user and group “firebird” before the installation:
groupadd firebird && useradd -M -b /opt -s /sbin/nologin \ -g firebird -u UID firebirdFor user firebird we do’t create home folder (switch -M), specify only base folder ( -b).
Shell nologin with switch -s prevents standard login to the server.
Depending on Linux distribution, we need to use library names with or without versions. The practical copy-paste commands are shown above, and below we describe them.
CentOS and Oracle Linux
Version 7 contains the necessary packages by default, version 8 requires installation of ncurses-compat-libs and creation of symlink libtommath.so.0.
Debian, Ubuntu and OpenSUSE
In version Debian 9 and 10, Ubuntu 18 and 20, OpenSUSE 15 we have to install libncurses5 and libtommath1, and to identify the version of ICU we can use search for the incomplete name:
in Ubuntu
apt-cache search libicu5in OpenSUSE 15
zypper search libicu6
Optionally, we could create user and group firebird.
After that we can install Firebird, for this we go to the folder where installation package was unpacked and start the installation:
./install.shhit Enter to confirm the installation, and when prompted, specify the password for SYSDBA.
Initially Firebird will be installed with the configuration file by default. Default configuration runs as architecture SuperServer with the modest values: cache (DefaultDbCachePages, also called Page buffers) per database is set to 2048, buffer for sortings (TempCacheLimit) is 64M (for the server in v3 and per database in v4).
To view non-commented parameters of firebird.conf, you can use the following command:
grep -v ^# firebird.conf | grep -v ^$If you will generate optimal configuration file with Firebird Configuration Calculator or manually change parameters, please note, that changes will be applied after the restart of Firebird service (in case of SuperServer and SuperClassic, in case of Classic need restart of all Firebird processes).
Please note that since Firebird 3 there are separate systemd units for SuperServer, SuperClassic and Classic.