Skip to main content

Data source: Custom


As the first step, you need to set up a machine for Database Lab Engine instance. See the guide.


With this data source type you can use any PostgreSQL backup tool (e.g. pg_basebackup, Barman, pgBackRest) to transfer the data to the Database Lab Engine instance.


To set up it you need to use following jobs:


Copy the example configuration file config.example.physical_generic.yml from the Database Lab repository to ~/.dblab/engine/configs/server.yml. For demo purposes we've used pg_basebackup tool, but you can use any tool suitable for the task. Check and update the following options:

  • Set secure server:verificationToken, it will be used to authorize API requests to the Engine
  • Set connection options in physicalRestore:options:envs, based on your tool
  • Set PostgreSQL commands in physicalRestore:options:customTool:
    • command: defines the command to restore data using a custom tool
    • restore_command: defines the PostgreSQL restore_command configuration option to refresh data
  • Set a proper version in Postgres Docker image tag (change the images itself only if you know what are you doing):
    • databaseContainer:dockerImage

Run Database Lab Engine

sudo docker run \
--name dblab_server \
--label dblab_control \
--privileged \
--publish \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /var/lib/dblab:/var/lib/dblab/:rshared \
--volume ~/.dblab/engine/configs:/home/dblab/configs \
--volume ~/.dblab/engine/meta:/home/dblab/meta \
--volume ~/.dblab/engine/logs:/home/dblab/logs \
--volume /sys/kernel/debug:/sys/kernel/debug:rw \
--volume /lib/modules:/lib/modules:ro \
--volume /proc:/host_proc:ro \
--detach \
--restart on-failure \

Parameter --publish means that only local connections will be allowed.

To allow external connections, consider either using additional software such as NGINX or Envoy or changing this parameter. Removing the host/IP part (--publish 2345:2345) allows listening to all available network interfaces. See more details in the official Docker command-line reference.

Restart in the case of failure