ubackup Documentation

Display
Print

Using Docker

ubackup can be deployed using a Linux Docker host or Windows 10 Docker host running in "Linux containers" mode.

Use the following Docker commands to deploy ubackup:

$ docker volume create ubackup_data
$ docker run -d -p 1111:80 -v ubackup_data:/app/DataLocal --name ubackup registry.softelvdm.com/ubackup

Once started, using your browser, you can access ubackup on port 1111 of the server where ubackup is running.

We recommend using persistent data so all the settings are preserved when restarting/upgrading ubackup, as documented in the following section.

Persistent ubackup Data

ubackup saves its data in the /app/DataLocal folder of the container.

It is recommended to persist ubackup data so your changes aren't lost after restarting or upgrading ubackup. A bind mount can be used to persist the data on the Docker host.

Instead of the volume created above, use the following to start ubackup, which saves the ubackup configuration data on the host file system:

$ docker run -d -p 1111:80 -v "/...your host path...:/app/DataLocal" --name ubackup registry.softelvdm.com/ubackup

...your host path... must be customized and point to an existing path on your host.

Upgrading

The following commands will stop the ubackup container, pull the latest image and start ubackup again.

$ docker stop ubackup
$ docker pull registry.softelvdm.com/ubackup

$ docker run -d -p 1111:80 -v ubackup_data:/app/DataLocal --name ubackup registry.softelvdm.com/ubackup
      or   (depending on how you installed it initially)
$ docker run -d -p 1111:80 -v "/...your host path...:/app/DataLocal" --name ubackup registry.softelvdm.com/ubackup

Using docker-compose

docker-compose can be used to deploy ubackup. The following is a sample docker-compose file:

version: "2"

services:

  ubackup:
    container_name: ubackup
    image: registry.softelvdm.com/ubackup:latest
    restart: always
    ports:
      - "1111:80"
    volumes:
      # The following persists the ubackup config data to your local file system. This is all the data that is modifiable using ubackup
      # and could be moved to another installation of ubackup to copy all settings, including login information, etc.
      - "/...your host path...:/app/DataLocal"
      # The following defines the host folder where backups are saved to the local file system.
      # The container folder can be changed in ubackup, by defining the backup folder when adding a new database server.
      # Multiple host folders can be used.
      # See https://ubackup.io/Documentation/Topic/g_installing_localfolder
      - "/backupsSQL:/backups"
      - "/backupsMySQL:/backups"
      # The following defines the shared folder where SQL servers place (temporary) backup files.
      # See https://ubackup.io/Documentation/Topic/g_installing_sqlshared
      - "/backups/sql:/ubackup/sharedfolder"
    environment:
      - TZ=America/New_York

Use the following command to start the ubackup service (assuming the folder where your ubackup docker-compose file is located is the current folder).

$ docker-compose up -d

Upgrading

Assuming the folder where your ubackup docker-compose file is located is the current folder, the following commands will stop ubackup, pull the latest image and start ubackup again.

$ docker-compose down
$ docker-compose pull
$ docker-compose up -d

ubackup Image Features

Folders

ubackup saves all its configuration data to /app/DataLocal. This folder should be mapped to a volume or preferably a bind mount (host file system).

Additional bind mounts may be required for backups to the local file system (see Local Folders) and for SQL temporary backup files (see SQL Shared Folders).

Ports

ubackup can expose port 80 and port 443 and support http:// and https:// access. In order to use https:// a reverse proxy such as nginx can be used, which is also where the certs would be defined.

When using a proxy, ubackup recognizes the following headers:

  • X-Forwarded-Proto
  • X-Forwarded-Host
  • X-Forwarded-Port
  • X-Real-IP
  • X-Forwarded-For

By setting these headers, ubackup could be used with an external URL, including SSL. However, this is not recommended as making ubackup externally accessible could expose database server information if the site were to be compromised.

Sample nginx definition for ubackup demonstrating use of headers:

server {
    listen 443 ssl;
    listen [::]:443 ssl http2;
    server_name ubackup.external.domain;
    ssl_certificate /etc/letsencrypt/live/ubackup.external.domain/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ubackup.external.domain/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
    location / {
        allow ...allowed ip address...; deny all;
        proxy_pass         http://ubackup;
        proxy_redirect     off;
        proxy_set_header   X-Forwarded-Proto https;
        proxy_set_header   X-Forwarded-Host $host;
        proxy_set_header   X-Forwarded-Port 443;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}