Skip to content
logo9minuti120x48
Menu
  • Home
  • Tutorial
    • Zaini
    • Stampa 3d
    • ebook
    • Informatica
  • Scritti
    • Racconti
    • Articoli
    • Temi
    • Storia
  • Video
  • Progetti
    • Progetto Carcere
    • Progetto Istruzione
    • Progetto Acque pulite
    • Progetto Tecnologia
    • Progetto Casa
    • Progetto Democrazia
    • Progetto Immigrazione
    • Storia
    • Progetto Storia
  • Chi siamo
    • LinkTree
  • Privacy Policy
    • Cookie Policy (EU)
  • Blog
  • Donazioni
Menu
urbackup installation cover fhd

UrBackup: installation and configuration with docker

Posted on 4 Dicembre 2020 by Alessandro Oppo

If you want to backup your Raspberry Pi, or maybe you want to do incremental backups for your laptop (it works both for Linux and Windows!) UrBackup is the right solution!

Urbackup is an open source tool that allows you to backup your data in a very easily way. It’s an awesome project and you can find more information on the UrBackup official website or in the GitHub page.

After some months that my backups are regularly saved every six hours I decided to write this tutorial. A thing that bothered me a lot is that in this moment there isn’t a nice tutorial that explain you all the most common setting for a selfhosted solution.

This tutorial require to have Docker and Docker-compose already installed.

Indice

  • Run the container
  • Install dattobd
  • Add new Linux clients on UrBackup
  • Allow the restore from the admin panel.
  • Uninstall or restart the UrBackup client

Run the container

Open your server terminal and run these two commands.

mkdir urbackup && cd urbackup

nano docker-compose.yml

Now paste this in the editor. I took this docker compose file from the official docker image page on Docker Hub and I modified it.

version: '2'

services:
  urbackup:
    image: uroni/urbackup-server:latest
    container_name: urbackup
    restart: unless-stopped
    environment:
      - PUID=1000 # Enter the UID of the user who should own the files here
      - PGID=1000  # Enter the GID of the user who should own the files here
      - TZ=Europe/Berlin # Enter your timezone
    volumes:
      - ./urbackup:/var/urbackup
      - ./backups:/backups
      # Uncomment the next line if you want to bind-mount the www-folder
      #- /path/to/wwwfolder:/usr/share/urbackup
    network_mode: "host"
    # Activate the following two lines for BTRFS support
    #cap_add:
    #  - SYS_ADMIN

CTRL+X to save.

Run sudo docker-compose up -d

When it asks you if to use dattobd or not, select 1. We need to use dattobd because in this way we can backup running databases. This is very convenient, because otherwise we would have to stop the databases.

Go on  http://YOUR_IP:55414/

Now I took a while before to understand how to setup the admin password.

Simply go to Settings>Users and change / add the password for the admin user.

Install dattobd

The UrBackup installation is completed, now we have to install dattobd.

You can find here the instructions to install dattobd for your distro. I’m using Ubuntu 20 so I’ll run.

sudo apt-key adv --fetch-keys https://cpkg.datto.com/DATTO-PKGS-GPG-KEY
echo "deb [arch=amd64] https://cpkg.datto.com/datto-deb/public/$(lsb_release -sc) $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/datto-linux-agent.list
sudo apt-get update
sudo apt-get install dattobd-dkms dattobd-utils

Add new Linux clients on UrBackup

Once that the server is installed add a new client. Choose Internet client, in this way it’s gonna do the backups also outside your home/lan (if you natted the server).

It gives you a string like this one, just copy and paste it and run it. Just check if the ip is the private and, in case that you want it to work also from outside your home, put your public ip.

If you see authkey in my case is equal to XXXXXXX, when you copy the code from the server, it gives you a random authkey, it’s gonna be the authentication of the client.

PRIVATE_IP is your private ip. Like 192.168.1.n. If you want to make it avalaible from outside your network put your public ip or a domain like freemyip.com

TF=`mktemp` && wget "http://PRIVATE_IP:55414/x?a=download_client&lang=it_IT&clientid=1&authkey=XXXXXXXXX&os=linux" -O $TF && sudo sh $TF; rm -f $TF

Once that you added the client you have to configure it. Maily you have to setup which folder to backup.

List of saved directories

sudo urbackupclientctl list

Save a directory (you can add how many directories you want)

sudo urbackupclientctl add-backupdir -d /var/lib/docker/volumes
sudo urbackupclientctl add-backupdir -d /home/ale

Remove a directory

sudo urbackupclientctl add-backupdir -d /home/ale

Allow the restore from the admin panel.

RESTORE=server-confirms is the option that we have to enable.

sudo nano /etc/default/urbackupclient

# Defaults for urbackup_client initscript
# sourced by /etc/init.d/urbackupclientbackend
# installed at /etc/default/urbackupclient by the maintainer scripts

#
# This is parsed as a key=value file
#

#logfile name
LOGFILE="/var/log/urbackupclient.log"

#Either debug,warn,info or error
LOGLEVEL=warn

#Max size of the log file before rotation
#Disable if you are using logrotate for
#more advanced configurations (e.g. with compression)
LOG_ROTATE_FILESIZE=20971520

#Max number of log files during rotation
LOG_ROTATE_NUM=10

#Tmp file directory
DAEMON_TMPDIR="/tmp"

# Valid settings:
#
# "client-confirms": If you have the GUI component the currently active user
#                    will need to confirm restores from the web interface.
#                    If you have no GUI component this will cause restores
#                    from the server web interface to not work
# "server-confirms": The server will ask the user starting the restore on
#                    the web interface for confirmation
# "disabled":        Restores via web interface are disabled.
#                    Restores via urbackupclientctl still work
#
RESTORE=server-confirms

#If true client will not bind to any external network ports (either true or false)
INTERNET_ONLY=true

Now everything should work fine and the backup should start after some minutes.

From the Backups panel you should now be able to restore a file or a folder just with one click.

Urbackup panel
Urbackup panel

Uninstall or restart the UrBackup client

If you want to restart the UrBackup client just run the first and the second command.

The last command is going to uninstall the UrBackup client.

sudo service urbackupclientbackend stop
sudo service urbackupclientbackend start
sudo uninstall_urbackupclient

If you encountered in any error, feel free to ask here or on the official forum.

Dammi un 5 virtuale, clicca like e condividi.

  • Fai clic qui per condividere su LinkedIn (Si apre in una nuova finestra) LinkedIn
  • Fai clic per condividere su Facebook (Si apre in una nuova finestra) Facebook
  • Fai clic per condividere su X (Si apre in una nuova finestra) X
  • Fai clic qui per condividere su Reddit (Si apre in una nuova finestra) Reddit
  • Fai clic per condividere su WhatsApp (Si apre in una nuova finestra) WhatsApp
  • Fai clic per condividere su Telegram (Si apre in una nuova finestra) Telegram
  • Fai clic per inviare un link a un amico via e-mail (Si apre in una nuova finestra) E-mail

Related

Cosa ne pensi? Fammelo sapere con un messaggioAnnulla risposta

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

Scoprici sui social

  • YouTube
  • Telegram
  • Facebook
  • RSS Feed

    Ultimi post

    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
    • Siamo quel che facciamo? – racconto breve
    • Il limite è sempre la mente – Racconto breve
    • L’ultimo giorno del carcere – Racconto breve

    Newsletter

    Invia un modulo.
    • YouTube
    • Facebook
    • Telegram
    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
      di Alessandro Oppo
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
      di Alessandro Oppo
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
      di Alessandro Oppo
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
      di Alessandro Oppo
    • Siamo quel che facciamo? – racconto breve
      di Alessandro Oppo
    Invia un modulo.
    ©2025 9minuti | Design: Newspaperly WordPress Theme
    Manage Cookie Consent
    Usiamo cookie per ottimizzare il nostro sito web ed i nostri servizi.
    Cookie funzionali Sempre attivo
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Gestisci opzioni Gestisci servizi Gestisci {vendor_count} fornitori Per saperne di più su questi scopi
    Visualizza preference
    {title} {title} {title}
     

    Caricamento commenti...