Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • How to do it?
  • Required configuration
  • Running the image (creation of the container)
  • Notes (important)
  • Server to Server replication
  • Example of bidirectional replication between two HFSQL docker containers
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
From version 22, a Docker container with the HFSQL server is available in Docker Hub:
Installing an HFSQL server is really simple: 1 line to type or script!
Remark: Only the 64-bit version is available.
How to do it?

Required configuration

The Linux distribution used does not matter. However, to use the Docker container that contains the HFSQL server, it is necessary to be familiar with Docker and, in particular:
  • know how to install a new container from the Docker image of the HFSQL server,
  • manage at least one volume required for data persistence,
  • manage network configuration inside Docker.

Running the image (creation of the container)

  • The name of the preset image is:
  • To persist data (e.g. if the image changes), you must:
    • Use a volume. The command to create a volume:
      "docker volume create <VolumeName>"
    • Mount the volume into the container on
  • Example of command line:
    sudo docker run -d
    --restart unless-stopped
    --name HFSQL_DOCKER
    --volume <NomVolume>:/var/lib/hfsql
    --publish 4923:4900
    Here are the parameters of the command above:
    • "name": indicates the name of the container.
    • "volume": indicates the "binding" between the volume and the directory defined in the container. In the HFSQL server configuration, the database path will be seen as "var/lib/hfsql".
    • "publish": indicates the container access port (4923 in this example) and the redirection to the port inside the container (4900: HFSQL standard port).
      In this example, the server will be accessible on port 4923 of the docker server.
    • the name of the docker package and the HFSQL version (US230053b" in this example).

Notes (important)

  • When the container is created, if there are no databases, you can define environment variables, for example, via the syntax:

    You can use one of the following three variables (or nothing for the default "admin" mode):
    • HFSQL_PASSWORD: Password of the initial account.
    • HFSQL_PASSWORD_FILE: Path of the file that contains the password of the initial account.
    • HFSQL_RANDOM_PASSWORD: The password for the initial account is generated randomly
      It is displayed on the standard output and can be found in the logs with the command
      docker logs HFSQL_DOCKER
    You can also use the following variable (optional): HFSQL_USER: Name of the account (admin by default.)
  • Reminder of basic Docker commands:
    • Stop a container:
      "docker stop <ID>"
    • Restart a container:
      "docker start <ID>"

Server to Server replication

"Server to Server" replication is not possible with the default HFSQL Docker image.
To perform this type of replication, a derived image must be made adding the port used for replication.
The new Docker image can be for example:
FROM windev/hfsql:26.0.062

Example of bidirectional replication between two HFSQL docker containers

To set up bidirectional replication between two HFSQL Docker containers running on the same machine:
  1. Create a Dockerfile with this content:
    FROM windev/hfsql:FR250083
    EXPOSE 4996
    EXPOSE 4997
  2. Create the Docker image with this command line (include the full stop):
    sudo docker build --force-rm -t hfsql:replication .
  3. Create a volume for the first server:
    sudo docker volume create vol_hfsql_4901
  4. Install and run the first server:
    sudo docker run -dit --restart unless-stopped --name HFSQL_4901
    --volume vol_hfsql_4901:/var/lib/hfsql
    --publish 4923:4900
    --publish 4996:4996 hfsql:replication
  5. Create a volume for the second server:
    sudo docker volume create vol_hfsql_4902
  6. Install and run the second server:
    sudo docker run -dit --restart unless-stopped --name HFSQL_4902
    --volume vol_hfsql_4902:/var/lib/hfsql --publish 4902:4900
    --publish 4997:4997 hfsql:replication
The rest of the configuration can be defined in the HFSQL Control Center (standard method to create a bidirectional replication between two servers).
Minimum version required
  • Version 22
This page is also available for…
Click [Add] to post a comment