Skip to main content

Docker compose

This page describes how to set up a self-managed instance of the Plumber Platform using Docker Compose, on a single Linux host.

💻 Requirements

On top of the common requirements (GitLab version, network access, DNS), this method needs a Linux server running the stack in 🐳 Docker containers:

  • OS: Ubuntu or Debian (tested and supported)
  • Hardware: CPU x86_64/amd64 with at least 2 cores, 4 GB RAM, and 100 GB of storage for Plumber
  • Installed software:
    • Git
    • Docker with the Compose plugin >= 2.20.2
    • OpenSSL (used to generate the secrets)
⚠️ Windows / WSL

Plumber’s install scripts target native Linux (Ubuntu, Debian). WSL (Windows Subsystem for Linux) has worked for some users, but we do not officially support it: depending on your WSL setup, how you cloned the repository and your Git settings, you may have to fix the scripts by hand. On a CRLF error (for example bad interpreter: /bin/bash^M, or a stray \r), convert the line endings with dos2unix.

🚀 Installation

1. Configure your DNS

Create a DNS A record pointing your chosen domain to your server’s public IP address:

  • Name: <your_plumber_domain> (e.g. plumber.mydomain.com)
  • Type: A
  • Content: <your-server-public-ip>

2. Setup Plumber

🧩 Plumber component in your GitLab

Pipelines include the Plumber CI/CD component from gitlab.com/getplumber/plumber. If your GitLab cannot reach gitlab.com, or you prefer a copy you control, the installer offers to copy it into a project of your instance and to publish its latest version to your CI/CD catalog. The same operation runs on its own at any time, from the installation repository:

Terminal window
read -rs -p "GitLab token: " PLUMBER_COMPONENT_TOKEN; echo; export PLUMBER_COMPONENT_TOKEN
./scripts/component-mirror.sh --gitlab-url https://gitlab.mydomain.com --group my-group

It creates (or reuses) the project my-group/plumber with the description the catalog requires, copies every branch and tag, flags the project as a CI/CD catalog project, runs the release pipeline on the latest tag and checks that the version is listed in the catalog before it reports success. It needs:

  • a token with the api scope from an Owner of the group (or an instance Admin), read from the environment for this run only and never stored
  • a runner available to the new project that can pull registry.gitlab.com/gitlab-org/release-cli

When it succeeds, set the copy as the component in Plumber, as an Admin, in Settings > Component: component_path is my-group/plumber, and component_ref stays empty to follow the latest version (or holds a tag to pin it). Pipelines then include gitlab.mydomain.com/my-group/plumber/plumber@<version>.

Info

The component’s job still pulls the getplumber/plumber image from Docker Hub. Mirroring that image into your registry is a separate step: set the image input of the component to your copy.

⏫ Update

To move to a new version, run the update script from the repository root:

Terminal window
./scripts/update.sh

The backend migrates the database on boot, so the first start after an update can take longer than usual. Add --component to also refresh your copy of the Plumber component and publish its newest version (the script asks for the Owner token).

Caution

Upgrades are sequential and additive: go through the releases in order, do not skip a line of the history by jumping several versions at once. To roll back, check out the previous release tag (git checkout v2.0.0) and run docker compose up -d. Never downgrade the database by hand.

🔄 Backup and restore

A full backup of a Plumber system holds three things:

  • .env, the configuration file (it holds the encryption key)
  • the PostgreSQL database
  • the custom CA certificates, if you use any

Two scripts in the installation repository cover both directions: scripts/backup.sh and scripts/restore.sh.

💽 Backup

From your installation repository, run the backup script, where 18 is the PostgreSQL version you run:

Terminal window
./scripts/backup.sh 18

The archive lands in the backups directory as backup_plumber-<date>.tar.gz. Optional S3 arguments upload it:

Terminal window
./scripts/backup.sh 18 s3://bucket-name/folder https://s3-endpoint-url region access-key secret-key

Danger

The archive contains .env, and therefore PLUMBER_TOKEN_ENCRYPTION_KEY. The database dump is unreadable without that key, and the key cannot be recreated: store the archive as the secret it is, and never restore a dump with a different .env.

Info

A cron job keeps backups regular. This one runs every day at 2am:

Terminal window
0 2 * * * /plumber-platform/scripts/backup.sh 18

Add it to your crontab with crontab -e (see this cron how-to).

🛳️ Restore

To restore a backup on a fresh system:

  1. Check the new system against the requirements

  2. Copy the backup file onto it

  3. Clone the installation repository

    Terminal window
    git clone https://github.com/getplumber/plumber-platform.git plumber-platform
    cd plumber-platform
  4. If the server’s IP address changed, update your DNS records. See Configure your DNS

  5. Start the stack

    Terminal window
    docker compose up -d
  6. Launch the restore script

    Terminal window
    ./scripts/restore.sh 18 <path_to_your_backup_file>

    An S3 URL (s3://bucket-name/folder/backup-file.tar.gz) works too, followed by the endpoint, region and credentials.

The restore puts back the .env of the backup. That is deliberate: the dumped data is sealed with the PLUMBER_TOKEN_ENCRYPTION_KEY of that file, and only that file can open it again.