Cloud and Docker

HQbird works on a cloud server the same way as on your own server. For Docker, there is a ready image for each Firebird line. Backups go directly to S3, with no file on the server disk. The connection to the center needs no inbound ports.

  • 4 images Firebird 5 · 4 · 3 · 2.5
  • 1 container Firebird, agent and console
  • S3 backup with no file on disk
  • 0 inbound ports for the connection to the center
  • 200–250 MB of memory per idle instance

Server · container · storage

Three parts of a cloud installation

You can install HQbird on a cloud server with the normal installer or run it in a Docker container. In both cases the agent connects to HQCenter on its own, and backups can go to S3 storage.

Diagram: applications and the browser connect to the HQbird container on the host; the agent connects to HQCenter on its own and sends backups to S3 cloud server or Docker host HQbird Firebird fbagent HQ Monitor volumes: /db · /backup · /opt ports: 3050 · 23050 cluster: 7051 · 7443 · 7444 Clients Firebird port 3050 Browser HQ Monitor 23050 HQCenter agent connects out S3 backups, HTTPS
Who connects to whom. Applications and the browser come in on the Firebird and HQ Monitor ports. The agent connects to HQCenter and to S3 on its own: no inbound ports are needed for this.
Server

Normal installer

One file installs Firebird, the agent and the console on a cloud server. The installer itself downloads nothing. A good fit when the whole server is for the database.

Container

Docker image

One container is one Firebird with all HQbird components. Data is on volumes and stays when you replace the container or the image.

Storage

Backups to S3

gbak and nbackup write to a stream, and the stream goes to a bucket. The backup needs no space on the server disk. It works both on a server and in a container.

More on the backups page →

Images · first start · compose

HQbird in Docker

The container installs HQbird with the same installer as a server. Firebird, the fbagent agent and HQ Monitor run inside. The agent installs the cluster node itself when the instance joins a cluster. It installs RCM only when this instance is assigned as the cluster RCM.

The images are in the IBSurgeon GitHub Container Registry. They are public: you do not need to log in to the registry. The image tag is the version of the HQbird kit.

ImageFirebirdFirebird portHQ Monitor
ghcr.io/ibsurgeon/hqbird2027-fb505.0305023050
ghcr.io/ibsurgeon/hqbird2027-fb404.0305023050
ghcr.io/ibsurgeon/hqbird2027-fb303.0305023050
ghcr.io/ibsurgeon/hqbird2027-fb252.5305023050

First start

  1. 1compose.yamlcopy it from the kit to a folder on the host
  2. 2SYSDBA passwordinto a secret file that only you can read
  3. 3Image, name, secretsset image and hostname, remove the # from the secrets: lines
  4. 4docker compose up -dthe container installs HQbird
  5. 5✓ healthyFirebird and the console respond
mkdir -p secrets
openssl rand -hex 12 > secrets/sysdba_password
chmod 600 secrets/sysdba_password
docker compose up -d
docker compose logs -f   # installation progress
docker compose ps        # wait for healthy

On a server with 2 cores, the installation at the first start takes about 20 seconds.

What you get

  • Firebird: <Docker host>:3050.
  • HQ Monitor: http://<Docker host>:23050/, login admin.
  • The installer creates the console password. It is in the file /opt/hqbird/conf/access.properties inside the container.
  • The agent name in HQCenter: the host name, the installation date and the Firebird line.

Daily work

TaskCommand
Service statedocker compose exec hqbird systemctl list-units --type=service
Restart Firebirddocker compose exec hqbird systemctl restart firebird
Firebird 3.0: the firebird-superserver service
isqldocker compose exec hqbird /opt/firebird/bin/isql -user SYSDBA localhost/3050:/db/my.fdb
Log for one hourdocker compose logs --since 1h
Stopdocker compose stop: Firebird closes the databases

Inside the container, the systemctl command controls the HQbird services, but it is not systemd. It understands the commands that HQbird programs use: start, stop, restart, status, list-units and others.

Variables · secrets · volumes

Settings and volumes

The container reads the settings only once, at the first start: this is the installation. Data, configuration, the license and updated programs are on volumes. They stay when you create the container again or change the image.

SettingWhat it does
HQBIRD_FB_PORTFirebird port inside the container, 3050 by default. HQ Monitor listens on 20000 + this port.
HQBIRD_HQM_PORTA different HQ Monitor port.
HQBIRD_AGENT_IDAgent name. By default it is made from the host name, the date and the port.
HQBIRD_HQM_LOGIN, secret hqmonitor_passwordHQ Monitor login and password.
HQBIRD_TRIAL_EMAIL, HQBIRD_TRIAL_ZONERequest for a trial license.
secret sysdba_passwordSYSDBA password of the new Firebird.
secret licenseLicense file.
secret attachThe attach.json file from HQCenter: it connects the agent to your center.
VolumePathContents
db/dbDatabases. Put your databases here.
backup/backupBackups.
opt/optFirebird, the agent, HQ Monitor, cluster node, RCM.
state/var/lib/hqbird-containerServices, console data, agent logs, machine ID.
trust/usr/libexec/hqbird-fbagentTrusted start of agent updates.
rootwork/var/lib/hqbird-fbagentWork folder for updates.
  • Host folders only for databases and backupsYou can replace the db and backup volumes with host folders. Give them to the user with uid 84: this is the firebird user in the image. Do not replace the other four volumes with host folders.
  • Backup of the volumesSave all six volumes together.
  • Do not change the host nameThe license is bound to the machine ID on the state volume and to the agent name. A new state volume is a new installation.
  • Connect to the center with one fileThe attach secret connects the agent to HQCenter at the first start. You do not need to enter the container for this.

Port publishing · firewall · second instance

Ports and several instances

Publish each port with the same number outside and inside the container: 3051:3051, not 3051:3050. The agent and the cluster report the port that they see inside the container.

PortWhatWhen needed
HQBIRD_FB_PORT (3050)Firebirdalways
20000 + Firebird port (23050)HQ Monitoralways
node port (7051)cluster nodethe instance joins a cluster
7443, 7444RCM and its web interfacethis agent runs RCM; one per host

Docker publishes ports past ufw. We checked it: with the ufw rule "only port 22", the Firebird and HQ Monitor ports were open from the internet. Use an external firewall, publish the port on one host address ("10.0.0.5:23050:23050") or add rules to the iptables DOCKER-USER chain.

Second instance on the same host

Each instance needs its own folder, project name, host name and ports. The project name sets the volume names. With the same name, the second start takes the volumes and the container of the first one.

  • Firebird: 3050 + N.
  • HQ Monitor: 20000 + Firebird port.
  • Cluster node: 7051 + N.
  • Only one instance on the host can run RCM.

Other Firebird lines on the same host follow the same rules, each with its own image.

Instance 1Instance 2
Project and host namehqbird-fb40-3051hqbird-fb40-3052
HQBIRD_FB_PORT30513052
Ports3051, 23051, 70523052, 23052, 7053
  • MemoryOne idle instance takes about 200–250 MB. We checked it: three Firebird 4.0 instances on a server with 2 cores and 4 GB of memory, one of them under load.
  • Firebird outside Docker on the same hostIf Firebird or HQbird already runs on the host without Docker, skip ports 3050, 23050 and 7051.

HQCenter · new image · cluster

Updates and cluster

You can update a container in two ways. Both keep the data.

From HQCenter

As on a normal server: the center updates the agent, HQ Monitor, Firebird, the cluster node and RCM inside the container. The updated programs are on a volume, so they stay after a restart.

With a new image

Change the version in the image line and run:

docker compose pull
docker compose up -d

At start, the container runs the installer of the new image in update mode. If the center already updated the agent to a version newer than the one in the image, the installer does not run: the version does not go down.

Container in a cluster

An instance in a container joins a cluster the same way as a server. The member address is the address of the Docker host. Publish the cluster ports in compose.yaml.

  • The node port, for example 7051: when the instance is a cluster member.
  • Ports 7443 and 7444: when this agent runs RCM. For the web interface on 7444, set operator_addr = 0.0.0.0:7444 in the RCM settings.
  • The node port in the cluster description must match the published port.

The agent installs the node a few minutes after you save the cluster. Until then, the node port does not respond.

More about the cluster and replication →

Cloud server · NAT · firewall

HQbird on a cloud server

On a cloud server, you install HQbird with the normal installer: one file, one command. Firebird, the agent and the console are inside the file: the installer downloads nothing. On Linux, it gets a few OS libraries (libtommath, ICU) from the distribution repository. If there is no repository, it prints the exact commands and changes nothing.

  • No inbound ports for the centerThe agent connects to HQCenter on its own. A server behind NAT or in a private cloud network looks the same in the center as a server in your rack.
  • OS firewallThe installer opens the port of the new Firebird and the HQ Monitor port in firewalld or ufw. You set up the firewall rules of the cloud itself.
  • Server requirementsAt least 2 GB of memory, 2 cores and 5 GB of disk. Linux x86-64 or Windows.
  • Linux distributionsUbuntu, Debian, AlmaLinux, Rocky, RHEL, Oracle Linux, openSUSE, RED OS and others with apt, dnf, yum or zypper.
  • A hundred servers by scriptEvery installation step is available as a switch. You can view the installation plan first: the command changes nothing.
  • Secrets are protectedA secret that you enter in the console goes to the agent encrypted. Secrets are hidden in reports and in configuration copies. In the agent configuration file, the S3 key is not encrypted: limit access to this file. On an Amazon EC2 server, you can work without a key: the agent uses the IAM role of the server.
  • Metrics in your GrafanaThe agent exports Firebird and server metrics in Prometheus format.
  • Cloud disk under controlThe agent measures read and write latency and forecasts when the disk becomes full. A slow or nearly full cloud disk is visible in the health report.

More about installation and updates →

Limits · tips

Good to know

  • Docker and ufwA published container port is open past ufw. Close it with an external firewall or publish it on one address.
  • Settings only at the first startVariables and secrets are read once. You cannot change the Firebird port, the host name and the secrets later: you need a new installation. You change jobs and other agent settings in HQ Monitor or from the center.
  • Scripts with docker compose execIn scripts, add the -T switch and </dev/null. Without them, the command reads standard input and takes the rest of the script.
  • Warnings before the connection to the centerUntil the agent connects to HQCenter, its log says that the connection settings are incomplete. This is normal.
  • Image signatureThe images are signed with the cosign tool. The public key to check them with the cosign verify command is not published yet.
  • Where it was testedUbuntu 22.04, Docker with Compose, a server with 2 cores and 4 GB of memory. A step-by-step installation guide for Ubuntu is available in Russian and Portuguese.

← Back to the HQbird 2027 overview