# firebird-docker **Repository Path**: mirrors_FirebirdSQL/firebird-docker ## Basic Information - **Project Name**: firebird-docker - **Description**: Docker images for Firebird Database - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-16 - **Last Updated**: 2026-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [//]: # (This file was auto-generated. Do not edit. See /src.) # firebird-docker Docker images for Firebird Database. # Quick reference - [Quick Start Guide](https://firebirdsql.org/file/documentation/html/en/firebirddocs/qsg5/firebird-5-quickstartguide.html) - [Language Reference](https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref50/firebird-50-language-reference.html) - [Release Notes](https://firebirdsql.org/file/documentation/release_notes/html/en/5_0/rlsnotes50.html) # Supported tags |`firebirdsql/firebird`|Dockerfile| |:-|:-:| |`5.0.4-bookworm`, `5-bookworm`, `bookworm`|[Dockerfile](./generated/5.0.4/bookworm/Dockerfile)| |`5.0.4-jammy`, `5-jammy`, `jammy`|[Dockerfile](./generated/5.0.4/jammy/Dockerfile)| |`5.0.4-noble`, `5-noble`, `noble`|[Dockerfile](./generated/5.0.4/noble/Dockerfile)| |`5.0.4-trixie`, `5-trixie`, `trixie`, `5.0.4`, `5`, `latest`|[Dockerfile](./generated/5.0.4/trixie/Dockerfile)| |`5.0.3-bookworm`|[Dockerfile](./generated/5.0.3/bookworm/Dockerfile)| |`5.0.3-jammy`|[Dockerfile](./generated/5.0.3/jammy/Dockerfile)| |`5.0.3-noble`|[Dockerfile](./generated/5.0.3/noble/Dockerfile)| |`5.0.3-trixie`, `5.0.3`|[Dockerfile](./generated/5.0.3/trixie/Dockerfile)| |`5.0.2-bookworm`|[Dockerfile](./generated/5.0.2/bookworm/Dockerfile)| |`5.0.2-jammy`|[Dockerfile](./generated/5.0.2/jammy/Dockerfile)| |`5.0.2-noble`|[Dockerfile](./generated/5.0.2/noble/Dockerfile)| |`5.0.2-trixie`, `5.0.2`|[Dockerfile](./generated/5.0.2/trixie/Dockerfile)| |`5.0.1-bookworm`|[Dockerfile](./generated/5.0.1/bookworm/Dockerfile)| |`5.0.1-jammy`|[Dockerfile](./generated/5.0.1/jammy/Dockerfile)| |`5.0.1-noble`|[Dockerfile](./generated/5.0.1/noble/Dockerfile)| |`5.0.1-trixie`, `5.0.1`|[Dockerfile](./generated/5.0.1/trixie/Dockerfile)| |`5.0.0-bookworm`|[Dockerfile](./generated/5.0.0/bookworm/Dockerfile)| |`5.0.0-jammy`|[Dockerfile](./generated/5.0.0/jammy/Dockerfile)| |`5.0.0-noble`|[Dockerfile](./generated/5.0.0/noble/Dockerfile)| |`5.0.0-trixie`, `5.0.0`|[Dockerfile](./generated/5.0.0/trixie/Dockerfile)| |`4.0.7-bookworm`, `4-bookworm`|[Dockerfile](./generated/4.0.7/bookworm/Dockerfile)| |`4.0.7-jammy`, `4-jammy`|[Dockerfile](./generated/4.0.7/jammy/Dockerfile)| |`4.0.7-noble`, `4-noble`|[Dockerfile](./generated/4.0.7/noble/Dockerfile)| |`4.0.7-trixie`, `4-trixie`, `4.0.7`, `4`|[Dockerfile](./generated/4.0.7/trixie/Dockerfile)| |`4.0.6-bookworm`|[Dockerfile](./generated/4.0.6/bookworm/Dockerfile)| |`4.0.6-jammy`|[Dockerfile](./generated/4.0.6/jammy/Dockerfile)| |`4.0.6-noble`|[Dockerfile](./generated/4.0.6/noble/Dockerfile)| |`4.0.6-trixie`, `4.0.6`|[Dockerfile](./generated/4.0.6/trixie/Dockerfile)| |`4.0.5-bookworm`|[Dockerfile](./generated/4.0.5/bookworm/Dockerfile)| |`4.0.5-jammy`|[Dockerfile](./generated/4.0.5/jammy/Dockerfile)| |`4.0.5-noble`|[Dockerfile](./generated/4.0.5/noble/Dockerfile)| |`4.0.5-trixie`, `4.0.5`|[Dockerfile](./generated/4.0.5/trixie/Dockerfile)| |`4.0.4-bookworm`|[Dockerfile](./generated/4.0.4/bookworm/Dockerfile)| |`4.0.4-jammy`|[Dockerfile](./generated/4.0.4/jammy/Dockerfile)| |`4.0.4-noble`|[Dockerfile](./generated/4.0.4/noble/Dockerfile)| |`4.0.4-trixie`, `4.0.4`|[Dockerfile](./generated/4.0.4/trixie/Dockerfile)| |`4.0.3-bookworm`|[Dockerfile](./generated/4.0.3/bookworm/Dockerfile)| |`4.0.3-jammy`|[Dockerfile](./generated/4.0.3/jammy/Dockerfile)| |`4.0.3-noble`|[Dockerfile](./generated/4.0.3/noble/Dockerfile)| |`4.0.3-trixie`, `4.0.3`|[Dockerfile](./generated/4.0.3/trixie/Dockerfile)| |`4.0.2-bookworm`|[Dockerfile](./generated/4.0.2/bookworm/Dockerfile)| |`4.0.2-jammy`|[Dockerfile](./generated/4.0.2/jammy/Dockerfile)| |`4.0.2-noble`|[Dockerfile](./generated/4.0.2/noble/Dockerfile)| |`4.0.2-trixie`, `4.0.2`|[Dockerfile](./generated/4.0.2/trixie/Dockerfile)| |`4.0.1-bookworm`|[Dockerfile](./generated/4.0.1/bookworm/Dockerfile)| |`4.0.1-jammy`|[Dockerfile](./generated/4.0.1/jammy/Dockerfile)| |`4.0.1-noble`|[Dockerfile](./generated/4.0.1/noble/Dockerfile)| |`4.0.1-trixie`, `4.0.1`|[Dockerfile](./generated/4.0.1/trixie/Dockerfile)| |`4.0.0-bookworm`|[Dockerfile](./generated/4.0.0/bookworm/Dockerfile)| |`4.0.0-jammy`|[Dockerfile](./generated/4.0.0/jammy/Dockerfile)| |`4.0.0-noble`|[Dockerfile](./generated/4.0.0/noble/Dockerfile)| |`4.0.0-trixie`, `4.0.0`|[Dockerfile](./generated/4.0.0/trixie/Dockerfile)| |`3.0.14-bookworm`, `3-bookworm`|[Dockerfile](./generated/3.0.14/bookworm/Dockerfile)| |`3.0.14-jammy`, `3-jammy`|[Dockerfile](./generated/3.0.14/jammy/Dockerfile)| |`3.0.14-noble`, `3-noble`|[Dockerfile](./generated/3.0.14/noble/Dockerfile)| |`3.0.14-trixie`, `3-trixie`, `3.0.14`, `3`|[Dockerfile](./generated/3.0.14/trixie/Dockerfile)| |`3.0.13-bookworm`|[Dockerfile](./generated/3.0.13/bookworm/Dockerfile)| |`3.0.13-jammy`|[Dockerfile](./generated/3.0.13/jammy/Dockerfile)| |`3.0.13-noble`|[Dockerfile](./generated/3.0.13/noble/Dockerfile)| |`3.0.13-trixie`, `3.0.13`|[Dockerfile](./generated/3.0.13/trixie/Dockerfile)| |`3.0.12-bookworm`|[Dockerfile](./generated/3.0.12/bookworm/Dockerfile)| |`3.0.12-jammy`|[Dockerfile](./generated/3.0.12/jammy/Dockerfile)| |`3.0.12-noble`|[Dockerfile](./generated/3.0.12/noble/Dockerfile)| |`3.0.12-trixie`, `3.0.12`|[Dockerfile](./generated/3.0.12/trixie/Dockerfile)| |`3.0.11-bookworm`|[Dockerfile](./generated/3.0.11/bookworm/Dockerfile)| |`3.0.11-jammy`|[Dockerfile](./generated/3.0.11/jammy/Dockerfile)| |`3.0.11-noble`|[Dockerfile](./generated/3.0.11/noble/Dockerfile)| |`3.0.11-trixie`, `3.0.11`|[Dockerfile](./generated/3.0.11/trixie/Dockerfile)| |`3.0.10-bookworm`|[Dockerfile](./generated/3.0.10/bookworm/Dockerfile)| |`3.0.10-jammy`|[Dockerfile](./generated/3.0.10/jammy/Dockerfile)| |`3.0.10-noble`|[Dockerfile](./generated/3.0.10/noble/Dockerfile)| |`3.0.10-trixie`, `3.0.10`|[Dockerfile](./generated/3.0.10/trixie/Dockerfile)| |`3.0.9-bookworm`|[Dockerfile](./generated/3.0.9/bookworm/Dockerfile)| |`3.0.9-jammy`|[Dockerfile](./generated/3.0.9/jammy/Dockerfile)| |`3.0.9-noble`|[Dockerfile](./generated/3.0.9/noble/Dockerfile)| |`3.0.9-trixie`, `3.0.9`|[Dockerfile](./generated/3.0.9/trixie/Dockerfile)| ## Snapshot (pre-release) images Pre-release builds from the Firebird development branches are available as snapshot images: | Tag | Source Branch | Description | |-----|---------------|-------------| | `6-snapshot` | `master` | Firebird 6.x development builds | | `5-snapshot` | `v5.0-release` | Firebird 5.x next-patch builds | > **Warning:** Snapshot images are built from unreleased code and may be unstable. They are rebuilt daily and replaced on each build. Do not use in production. ```bash # Pull latest Firebird 6.x development snapshot docker pull firebirdsql/firebird:6-snapshot # Pull latest Firebird 5.x patch snapshot docker pull firebirdsql/firebird:5-snapshot ``` ## Architectures Images for Firebird 5.x and later are available for both `linux/amd64` and `linux/arm64`. Firebird 3.x and 4.x images are `linux/amd64` only. ## Discontinued distributions Debian 11 `bullseye` images (`*-bullseye` tags) are no longer built, because Debian 11 reached its end of life. The tags already published remain available, but they will not receive any updates, including security fixes. Please move to `trixie` (the default) or `bookworm`. # How to use this image Image defaults: - `EXPOSE 3050/tcp` - `VOLUME /var/lib/firebird/data` ## Start a Firebird server instance ```bash docker run \ -e FIREBIRD_ROOT_PASSWORD=************ \ -e FIREBIRD_USER=alice \ -e FIREBIRD_PASSWORD=************ \ -e FIREBIRD_DATABASE=mirror.fdb \ -e FIREBIRD_DATABASE_DEFAULT_CHARSET=UTF8 \ -v ./data:/var/lib/firebird/data \ --detach firebirdsql/firebird ``` ## Using [`Docker Compose`](https://github.com/docker/compose) ```yaml services: firebird: image: firebirdsql/firebird restart: always environment: - FIREBIRD_ROOT_PASSWORD=************ - FIREBIRD_USER=alice - FIREBIRD_PASSWORD=************ - FIREBIRD_DATABASE=mirror.fdb - FIREBIRD_DATABASE_DEFAULT_CHARSET=UTF8 volumes: - ./data:/var/lib/firebird/data ``` ## Connect to an existing instance using `isql` ```bash docker run -it --rm firebirdsql/firebird isql -u SYSDBA -p ************ SERVER:/path/to/file.fdb ``` ## Environment variables The following environment variables can be used to customize the container. ### `FIREBIRD_ROOT_PASSWORD` Firebird installer generates a one-off password for `SYSDBA` and stores it in `/opt/firebird/SYSDBA.password`. If `FIREBIRD_ROOT_PASSWORD` is set, `SYSDBA` password will be changed. And the file `/opt/firebird/SYSDBA.password` will be removed. ### `FIREBIRD_USER` Creates an user in Firebird security database. You must inform a password in `FIREBIRD_PASSWORD` variable. Otherwise the container initialization will fail. If the username is not a regular SQL identifier (e.g. it contains dots or dashes, like `dba.backend`) it will be created as a [delimited identifier](https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-structure.html#fblangref50-structure-identifiers), which is case-sensitive in Firebird. Clients must then connect quoting the username in double quotes, e.g. `isql -u '"dba.backend"'`. ### `FIREBIRD_DATABASE` Creates a new database. Ignored if the database already exists. Database location is `/var/lib/firebird/data`. Absolute paths (outside this folder) are allowed. You may use `FIREBIRD_DATABASE_PAGE_SIZE` to set the database page size. And `FIREBIRD_DATABASE_DEFAULT_CHARSET` to set the default character set. ### `FIREBIRD_USE_LEGACY_AUTH` Enables [legacy authentication](https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30-compat-legacyauth) (not recommended). ### `FIREBIRD_CONF_*` Any variable starting with `FIREBIRD_CONF_` can be used to set values in Firebird configuration file (`firebird.conf`). E.g. You can use `FIREBIRD_CONF_DataTypeCompatibility=3.0` to set the value of key `DataTypeCompatibility` to `3.0` in `firebird.conf`. Please note that keys are case sensitive. And any key not present in `firebird.conf` will be ignored. ### `*_FILE` Any of the previously listed environment variables may be loaded from file by appending the `_FILE` suffix to the variable name. E.g. `FIREBIRD_PASSWORD_FILE=/run/secrets/firebird-passwd` will load `FIREBIRD_PASSWORD` with the content from `/run/secrets/firebird-passwd` file. Note that both the original variable and its `_FILE` variant are mutually exclusive. Trying to use both will cause the container initialization to fail. ## Using database aliases To use database aliases, create your own `databases.conf` file and configure a [Docker bind mount](https://docs.docker.com/engine/storage/bind-mounts/) for it at `/opt/firebird/databases.conf`. > **IMPORTANT:** A bind mount _replaces_ the entire file inside the container. The default `databases.conf` shipped with the image contains a required entry for the security database (`security.db`). If your file does not include this entry, Firebird cannot open the security database and the container will fail to start with an error like: > > ``` > I/O error during "open" operation for file "security.db" > ``` To keep the required entries, start from the default file of the image and append your aliases to it: ```bash # Extract the default databases.conf from the image docker run --rm firebirdsql/firebird cat /opt/firebird/databases.conf > databases.conf # Append your aliases echo "mydb = /var/lib/firebird/data/mydb.fdb" >> databases.conf # Use it with a bind mount docker run -d --mount type=bind,src=$(pwd)/databases.conf,dst=/opt/firebird/databases.conf \ -e FIREBIRD_ROOT_PASSWORD=my_secret_password firebirdsql/firebird ``` Extracting the file from the same image (and tag) you run also ensures you get the correct security database entry, which is different for each Firebird version. More information: - [Firebird Quick Start Guide](https://www.firebirdsql.org/file/documentation/html/en/firebirddocs/qsg3/firebird-3-quickstartguide.html#qsg3-config-security) (section "Use database aliases") ## Persisting the security database Firebird users are stored in the security database: `/opt/firebird/security5.fdb` (`security4.fdb` for Firebird 4, `security3.fdb` for Firebird 3). This includes users created with `FIREBIRD_USER`, with `CREATE USER`, or by your application. This file is part of the container, not of the `/var/lib/firebird/data` volume. It is kept when the container restarts, but a _new_ container (e.g. after `docker compose down` and `up`, or when upgrading the image) starts with the default security database of the image. Only `SYSDBA` and `FIREBIRD_USER` are then set up again. To keep your users, store the security database outside the container with a [Docker bind mount](https://docs.docker.com/engine/storage/bind-mounts/). Start from the default file of the image: ```bash # Extract the default security database from the image docker create --name fb-tmp firebirdsql/firebird docker cp fb-tmp:/opt/firebird/security5.fdb ./security5.fdb docker rm fb-tmp # Use it with a bind mount docker run -d --mount type=bind,src=$(pwd)/security5.fdb,dst=/opt/firebird/security5.fdb \ -v ./data:/var/lib/firebird/data \ -e FIREBIRD_ROOT_PASSWORD=my_secret_password firebirdsql/firebird ``` Or, with Docker Compose: ```yaml volumes: - ./data:/var/lib/firebird/data - ./security5.fdb:/opt/firebird/security5.fdb ``` > **IMPORTANT:** > - The file must exist on the host before the container starts. With `-v` (or a Compose short syntax volume), a missing file is silently created as an empty _directory_, and Firebird cannot open the security database. `--mount` fails with an error instead. > - Use the file name of the Firebird version you run, and extract it from an image of that same major version. > - Do not rely on `/opt/firebird/SYSDBA.password`: it belongs to the container, not to your security database, and is not kept with it. Set `FIREBIRD_ROOT_PASSWORD` on every start, or keep track of the `SYSDBA` password yourself. > - When running as a non-root user, the file must be writable by that user (e.g. `chown 84:0 security5.fdb`). > - Never use the same file in two containers running at the same time. ## Using Firebird Events To use this image with [Firebird Events](https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref50/firebird-50-language-reference.html#fblangref50-psql-postevent) you need to: - use `FIREBIRD_CONF_RemoteAuxPort` environment variable to set the value of `RemoteAuxPort` configuration to a specific port (e.g. 3051); and - [Publish](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/) this port to the host. More information: - [This answer](https://stackoverflow.com/a/49918178/33244) from Mark Rotteveel at Stack Overflow. - [The Power of Firebird Events](https://www.firebirdsql.org/file/documentation/papers_presentations/Power_Firebird_events.pdf) from Milan Babuškov. ## Initializing the database contents When creating a new database with `FIREBIRD_DATABASE` environment variable you can initialize it running one or more shell or SQL scripts. Any file with extensions `.sh`, `.sql`, `.sql.gz`, `.sql.xz` and `.sql.zst` found in `/docker-entrypoint-initdb.d/` will be executed in _alphabetical_ order. `.sh` files without file execute permission (`+x`) will be _sourced_ rather than executed. > **IMPORTANT:** Scripts will only run if you start the container with a data directory that is empty. Any pre-existing database will be left untouched on container startup. ## Setting container time zone The container runs in the `UTC` time zone by default. To change this, you can set the `TZ` environment variable: ```yaml environment: - TZ=America/New_York ``` Alternatively, you can use the same time zone as your host system by mapping the `/etc/localtime` and `/etc/timezone` system files: ```yaml volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro ``` ## Backup and Restore ### For online databases If the database is in use, call `gbak` inside the running container using Firebird Service Manager (`-se` switch) for best performance. The following commands will backup and restore a database **in the data directory** (`/var/lib/firebird/data`) of the running container. ```bash # Online backup FIREBIRD_CONTAINER=MY_CONTAINER_NAME_OR_ID DATABASE_FILE=MY_DATABASE.fdb BACKUP_FILE=MY_DATABASE.fbk docker exec $FIREBIRD_CONTAINER bash -c "gbak -b -user SYSDBA -pas \$FIREBIRD_ROOT_PASSWORD -se localhost:service_mgr \$FIREBIRD_DATA/$DATABASE_FILE \$FIREBIRD_DATA/$BACKUP_FILE" ``` ```bash # Online restore FIREBIRD_CONTAINER=MY_CONTAINER_NAME_OR_ID BACKUP_FILE=MY_DATABASE.fbk DATABASE_FILE=MY_DATABASE.fdb docker exec $FIREBIRD_CONTAINER bash -c "gbak -c -user SYSDBA -pas \$FIREBIRD_ROOT_PASSWORD -se localhost:service_mgr \$FIREBIRD_DATA/$BACKUP_FILE \$FIREBIRD_DATA/$DATABASE_FILE" ``` ### For offline databases > **IMPORTANT:** Never use this with online (running) database files. If you don't have a running server, create an ephemeral container to run `gbak` directly over the database files. The following commands will backup and restore a database **in the current directory** (`$PWD`). ```bash # Offline backup FIREBIRD_IMAGE=firebirdsql/firebird DATABASE_FILE=MY_DATABASE.fdb BACKUP_FILE=MY_DATABASE.fbk docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -b /pwd/$DATABASE_FILE /pwd/$BACKUP_FILE ``` ```bash # Offline restore FIREBIRD_IMAGE=firebirdsql/firebird BACKUP_FILE=MY_DATABASE.fbk DATABASE_FILE=MY_DATABASE.fdb docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -c /pwd/$BACKUP_FILE /pwd/$DATABASE_FILE ``` More information: - [Firebird’s gbak Backup and Restore Utility](https://firebirdsql.org/file/documentation/html/en/firebirddocs/gbak/firebird-gbak.html) from Norman Dunbar and Mark Rotteveel. - [Quick Guide for Gbak Backup-Restore](https://ib-aid.com/articles/firebird-gbak-backup-tips-and-tricks) from IBSurgeon.