Install and Setup BackupPC Server on Ubuntu 20.04

Last Updated:

In this guide, we are going to learn how to install and setup BackupPC Server on Ubuntu 20.04. BackupPC is a high-performance enterprise-grade cross-platform backup software suite with a web-based frontend. It can be used for backing up Linux, Windows and Mac OSXs PCs and laptops to a server’s disk.

BackupPC provides quite a number of features;

  • Provides a web interface which allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.
  • It supports Data deduplication: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.
  • It supports data Compression: Since only new files (not already pooled) need to be compressed, there is only a modest impact on CPU time.
  • It is Open-source: BackupPC is hosted on Github, and is distributed under a GPL license.
  • No client-side software is needed.
  • A full set of restore options is supported, including direct restore (via smbclient, tar, or rsync/rsyncd) or downloading a zip or tar file.

Read more on About BackupPC page.

Installing BackupPC Server on Ubuntu 20.04

Update System packages

To begin with, ensure that your system packages are up-to-date.

apt update
apt upgrade

Install BackupPC

As of this writing, BackupPC 4.3.2 is the latest stable release version. Unfortunately, the default Ubuntu 20.04 repos provides BackupPC 3.3.2;

apt show backuppc
Package: backuppc
Version: 3.3.2-3
Priority: optional
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian BackupPC Team <[email protected]>
Installed-Size: 2,314 kB
Download-Size: 460 kB
APT-Sources: focal/main amd64 Packages

As such, we are going to build BackupPC 4 on Ubuntu 20.04 from source.

Install Required Dependencies

apt install apache2 apache2-utils libapache2-mod-perl2 par2 perl smbclient rsync tar gcc zlib1g zlib1g-dev rrdtool git make perl-doc libnss-winbind winbind libarchive-zip-perl libfile-listing-perl libxml-rss-perl libcgi-session-perl libacl1-dev curl -y

Create BackupPC User

BackupPC is usually run by a low privileged backuppc user with /var/lib/backuppc as the working directory. As such, create a backuppc system user by executing the command below;

useradd -r -m -d /var/lib/backuppc -s /bin/bash -c "BackupPC user" backuppc

Build and Install BackupPC XS

BackupPC V4+ requires BackupPC XS, a perl module that implements various BackupPC functions in a perl-callable module.

Download BackupPC XS source code;

git clone

Build and install BackupPC XS;

cd backuppc-xs/

To install this module, run the following commands:

perl Makefile.PL

Run the make test to verify the correctness of the compilation of the module;

make test

If everything is in order, the result should be pass;

t/BackupPC_XS.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.00 usr 0.04 sys + 0.07 cusr 0.03 csys = 0.14 CPU)
Result: PASS

Install BackupPC XS module;

make install

There are other optional but highly RECOMMENDED modules that have been installed on the requirements section above.

Install BackupPC rsync_bpc

In order to be able to backup clients using rsync command, you need rsync_bpc module installed. Rsync-bpc is a customized version of rsync that is used as part of BackupPC.

Download rsync_bpc source code;

cd ~
git clone

Compile and install the rsync_bpc module;

cd rsync-bpc

This configures rsync_bpc with the default options. You can check other configuration options with the command, ./configure --help.

Compile and install rsync_bpc;

make install

Install BackupPC on Ubuntu 20.04

Once all the above is done, you can now install BackupPC itself. Download the source code cloning the Github repository;

cd ~
git clone

Navigate to backup source directory;

cd backuppc

Generate the latest release BackupPC tarball from the source file and BackupPC build tools;

VER=`curl --silent "" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
./makeDist --nosyntaxCheck --releasedate 'date -u "+%d %b %Y"' --version $VER

This creates BackupPC tarball and store it under distr directory in the current working directory as, for example, dist/BackupPC-4.3.2.tar.gz, for the current stable release (as of this writing).

Extract the source code;

tar zxf dist/BackupPC-*.tar.gz

Build and install BackupPC server;

cd BackupPC-*

The script when executed in this way, will run interactively. Answer the prompts accordingly. Press ENTER to accept the defaults.

Is this a new installation or upgrade for BackupPC?  If this is
an upgrade please tell me the full path of the existing BackupPC
configuration file (eg: /etc/BackupPC/  Otherwise, just
hit return.

--> Full path to existing main []? 

I found the following locations for these programs:

    bzip2        => /usr/bin/bzip2
    cat          => /usr/bin/cat
    df           => /usr/bin/df
    gtar/tar     => /usr/bin/tar
    gzip         => /usr/bin/gzip
    hostname     => /usr/bin/hostname
    nmblookup    => /usr/bin/nmblookup
    par2         => /usr/bin/par2
    perl         => /usr/bin/perl
    ping         => /usr/bin/ping
    ping6        => /usr/bin/ping6
    rrdtool      => /usr/bin/rrdtool
    rsync        => /usr/bin/rsync
    rsync_bpc    => /usr/local/bin/rsync_bpc
    sendmail     => 
    smbclient    => /usr/bin/smbclient
    split        => /usr/bin/split
    ssh/ssh2     => /usr/bin/ssh

--> Are these paths correct? [y]? y

Please tell me the hostname of the machine that BackupPC will run on.

--> BackupPC will run on host [ubuntu20]? 

BackupPC should run as a dedicated user with limited privileges.  You
need to create a user.  This user will need read/write permission on
the main data directory and read/execute permission on the install
directory (these directories will be setup shortly).

The primary group for this user should also be chosen carefully.
The data directories and files will have group read permission,
so group members can access backup files.

--> BackupPC should run as user [backuppc]?

Please specify an install directory for BackupPC.  This is where the
BackupPC scripts, library and documentation will be installed.

--> Install directory (full path) [/usr/local/BackupPC]? 

Please specify a data directory for BackupPC.  This is where all the
PC backup data is stored.  This file system needs to be big enough to
accommodate all the PCs you expect to backup (eg: at least several GB
per machine).

--> Data directory (full path) [/data/BackupPC]? /var/lib/backuppc

BackupPC has SCGI and CGI perl interfaces that run under Apache.  You need
to pick which one to run.

The traditional alternative is to use CGI.  In this case, an executable needs
to be installed Apache's cgi-bin directory.  This executable needs to run as
set-uid backuppc, or it can be run under mod_perl with Apache
running as user backuppc.

--> SCGI port (-1 to disable) [-1]? 
--> CGI bin directory (full path, or empty for no CGI) []? /var/www/cgi-bin/BackupPC

BackupPC's CGI and SCGI script need to display various PNG/GIF
images that should be stored where Apache can serve them.  They
should be placed somewhere under Apache's DocumentRoot.  BackupPC
also needs to know the URL to access these images.  Example:

    Apache image directory:  /var/www/htdocs/BackupPC
    URL for image directory: /BackupPC

The URL for the image directory should start with a slash.

--> Apache image directory (full path, or empty for no S/CGI) []? /var/www/html/BackupPC
--> URL for image directory (omit http://host; starts with '/', or empty for no S/CGI) []? /BackupPC

Ok, we're about to:

  - install the binaries, lib and docs in /usr/local/BackupPC
  - create the data directory /var/lib/backuppc
  - optionally install the cgi-bin interface
  - create/update the file /etc/BackupPC/

--> Do you want to continue? [y]?y
Ok, it looks like we are finished.  There are several more things you
will need to do:

  - Browse through the config file, /etc/BackupPC/,
    and make sure all the settings are correct.  In particular,
    you will need to set $Conf{CgiAdminUsers} so you have
    administration privileges in the CGI interface.

  - Edit the list of hosts to backup in /etc/BackupPC/hosts.

  - Read the documentation in /usr/local/BackupPC/doc/BackupPC.html.
    Please pay special attention to the security section.

  - Verify that the CGI script BackupPC_Admin runs correctly.  You might
    need to change the permissions or group ownership of BackupPC_Admin.
    If this is an upgrade and you are using mod_perl, you will need
    to restart Apache.  Otherwise it will have stale code.

  - BackupPC should be ready to start.  Don't forget to run it
    as user backuppc!  The installation also contains
    a systemd/backuppc.service script that can be installed so
    that BackupPC can auto-start on boot.  This will also enable
    administrative users to start the server from the CGI interface.
    See systemd/README.


If you want to run non-interactive installation;

./ --batch --cgi-dir /var/www/cgi-bin/BackupPC --data-dir /var/lib/backuppc --hostname ubuntu20 --html-dir /var/www/html/BackupPC --html-dir-url /BackupPC --install-dir /usr/local/BackupPC

Configure Apache Web Server for BackupPC

Copy the sample BackupPC Apache configuration file to Apache enabled configurations directory;

cp ~/backuppc/BackupPC-*/httpd/BackupPC.conf /etc/apache2/conf-available/

Next, configure Apache to allow external access to BackupPC;

sed -i 's/Require local/Require all granted/' /etc/apache2/conf-available/BackupPC.conf

Configure Apache to run as BackupPC user, backuppc.

sed -i 's/www-data/backuppc/g' /etc/apache2/envvars

Remove the set-uid from BackupPC admin CGI file;

chmod u-s /var/www/cgi-bin/BackupPC/BackupPC_Admin

Configure BackupPC Apache Basic Authentication

Change the Basic authentication file if you so wish;

sed -i 's#^AuthUserFile.*$#AuthUserFile /etc/BackupPC/.allowed#' /etc/apache2/conf-available/BackupPC.conf

Change the basic authentication message;

sed -i 's/^AuthName.*$/AuthName "Kifarunix-demo BackupPC Restricted Access"/' /etc/apache2/conf-available/BackupPC.conf

Create the BackupPC basic authentication user and password. This information should be stored on a file specified by the value of the AuthUserFile parameter above. For example, to create web authentication user called kifarunixadmin;

htpasswd -c /etc/BackupPC/.allowed kifarunixadmin

You can add another user, say kifarunixuser.

htpasswd /etc/BackupPC/.allowed kifarunixuser

Adjust the ownership and permissions of the auth user file;

chmod 666 /etc/BackupPC/.allowed
chown backuppc:backuppc /etc/BackupPC/.allowed

Configure BackupPC Administrative User

Default Administrative user for BackupPC is defined under CGI user interface configuration settings section. Normal users can only access information specific to their host. They can also start/stop/browse/restore backups. Administrative users have full access to all hosts, plus overall status and log information. In this demo, we set the kifarunixadmin user as BackupPC admin.

vim /etc/BackupPC/
$Conf{CgiAdminUserGroup} = 'kifarunixadmin';
$Conf{CgiAdminUsers} = 'kifarunixadmin';

Define BackupPC Client Backup User

By default, BackupPC uses the root user on the backup clients for backup purposes.

$Conf{RsyncSshArgs} = [
        '-e', '$sshPath -l root',

It is more secure to allow backup via a low-privileged user. In this demo, we will create a non-privileged user, backuppc, on every client to backup which is only allowed to run rsync command with sudo rights for backup purposes. Therefore, change this user accordingly.

$Conf{RsyncSshArgs} = [
        '-e', '$sshPath -l backuppc',

We will leave other Rsync settings with the default options.\

Note that all these configurations are overwritable via the per-client configuration.

Enable BackupPC Apache configuration and CGI modules;

Run the commands below to enable BackupPC Apache configuration and CGI modules;

a2enconf BackupPC
a2enmod cgid

Disable Apache default site and Disable directory listing;

a2dissite 000-default.conf
mv /var/www/html/index.html /var/www/html/index.html.old
sed -i 's/Options Indexes FollowSymLinks/Options -Indexes +FollowSymLinks/' /etc/apache2/apache2.conf

Hide web server version on error pages;

echo -e 'ServerSignature Off\nServerTokens Prod' >> /etc/apache2/apache2.conf

Check Apache for any errors;

apachectl -t
Syntax OK

Start and enable Apache to run on system boot;

systemctl enable --now apache2

Restart Apache if it were already running;

systemctl restart apache2

Running BackupPC Service

Copy BackupPC sample systemd service file from the source directory;

cp ~/backuppc/BackupPC-*/systemd/backuppc.service /etc/systemd/system/

Edit the service group;

sed -i 's/^#Group/Group/' /etc/systemd/system/backuppc.service
sed -i 's#PIDFile=/var/run/#PIDFile=/run/#' /etc/systemd/system/backuppc.service

Reload systemd service configuration;

systemctl daemon-reload

Start and enable BackupPC service;

systemctl enable --now backuppc

To check the status;

systemctl status backuppc
● backuppc.service - BackupPC server
     Loaded: loaded (/etc/systemd/system/backuppc.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-05-17 19:29:38 UTC; 7s ago
   Main PID: 3772 (BackupPC)
      Tasks: 1 (limit: 2283)
     Memory: 8.6M
     CGroup: /system.slice/backuppc.service
             └─3772 /usr/bin/perl /usr/local/BackupPC/bin/BackupPC

May 17 19:29:38 ubuntu20 systemd[1]: Started BackupPC server.

Accessing BackupPC Web User Interface

If firewall is running, allow external access to Apache.

ufw allow 80/tcp

You can now access BackupPC via the URL http://server_IP_OR_hostname/BackupPC_Admin.

Authenticate and proceed to BackupPC web dashboard.

Install and Setup BackupPC Server on Ubuntu 20.04

When you authenticate as admin user, this is the interface you get;

Install and Setup BackupPC Server on Ubuntu 20.04

When you authenticate as non admin user, this is the interface you get;

Install and Setup BackupPC Server on Ubuntu 20.04

BackupPC is now installed on Ubuntu 20.04. You can now go ahead and add hosts for backing up;

Backup Linux systems with BackupPC using Rsync Protocol

Backup Windows System via SMB Using BackupPC

Backup Windows System with BackupPC Using Rsyncd


Installing BackupPC 4 from tarball or git on Ubuntu

BackupPC Documentation: Installing BackupPC

Other Related Tutorials

Install and Configure BackupPC on Debian 10

How to Install and Configure BackupPC as a Backup Server on Ubuntu 18.04

Install and Configure BackupPC on CentOS 8


We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
Co-founder of, Linux Tips and Tutorials. Linux/Unix admin and author at

21 thoughts on “Install and Setup BackupPC Server on Ubuntu 20.04”

  1. Hi gen_too,
    Thank you for writing “Install and Setup BackupPC Server on Ubuntu 20.04”.
    Its absolutely brilliant!
    I’m installing on Xubuntu 20.04 long-term support (LTS), and found the errors below.
    Perhaps these errors are very subtle differences between Xubuntu and Ubuntu
    ./makeDist –nosyntaxCheck –releasedate ‘date -u “+%d %b %Y”‘ –version $VER
    Rather than:
    ./makeDist –nosyntaxCheck –releasedate “date -u “+%d %b %Y”” –version $VER

    I couldn’t get the following to work:
    echo -e ‘ServerSignature Off\nServerTokens Prod’ >> /etc/apache2/apache2.conf
    sudo echo -e ‘ServerSignature Off\nServerTokens Prod’ >> /etc/apache2/apache2.conf
    Error was:
    bash: /etc/apache2/apache2.conf: Permission denied
    I ended up using sudo nano to edit apache2.conf

    Apart from that, everything worked!
    I learn best by analysing practical examples of code and what it does, rather than reading pages of help syntax.
    So there was plenty of examples from different activities to demonstrate this:
    apt, sed, useradd, git, make, grep…
    I could see how all these tools can be used to create a functioning application server, namely BackupPC.
    I’m already somewhat, familiar with BackupPC having run version 3.3.2 as an app installed in ClearOS, however want to investigate using ZFS file system to replicate the BackupPC data pool offsite and need the functionality of BackupPC 4.3.2.

    Xubuntu 20.04LTS provides ZFS “out-of-the-box” and your instructions have allowed a BackupPC 4.3.2, ZFS enabled application server to be quickly built for evaluation.


  2. Great tutorial.
    I’ve copied these instructions 3 times and each time the server runs fine, but I’m connected with a non-privilaged user.
    I can’t create any hosts?

    • Hi. You should be able to hosts from the web interface.
      Any error you get when adding hosts?

      Also, as backuppc user, can you can add hosts on the BackupPC hosts file from command line

      • Your set up (instructions) is not putting the admin user in the .allowed file for site access, so there is only access for the user account, which can’t modify anything.

        Not sure how, still trying to track it down. Was hoping it would be in these comments.

        • Hi, thanks for the feedback but not sure if you followed correctly.
          htpasswd -c /etc/BackupPC/.allowed kifarunixadmin is the admin user as defined here;
          vim /etc/BackupPC/
          $Conf{CgiAdminUserGroup} = 'kifarunixadmin';
          $Conf{CgiAdminUsers} = 'kifarunixadmin';

          and also try, chown -R backuppc: /data/BackupPC and restart backuppc

  3. Anyone got an idea how to resolve this? When I initiate a backup, I am getting errors that the backuppc user doesn’t have permissions to write to /data/BackupPC as the backuppc user is what is running apache. But looking at the permissions, backuppc user does have access to that directory.

    drwxrwxr-x 5 backuppc backuppc 4.0K May 23 09:52 BackupPC

    2021-05-23 11:16:12 User backupadmin requested backup of server-backup (server-backup)
    2021-05-23 11:16:13 server-backup: mkdir /data/BackupPC: Permission denied at /usr/local/BackupPC/bin/BackupPC_dump line 245.

    • Hi Mitch,

      Did you try to update the user here;

      $Conf{CgiAdminUserGroup} = 'kifarunixadmin';
      $Conf{CgiAdminUsers} = 'kifarunixadmin';

  4. Ok, so everything went ok with the settings only that at the end I get:

    Error: Unable to connect to BackupPC server
    This CGI script (/BackupPC_Admin) is unable to connect to the BackupPC server on backuppc-vm port -1.
    The error was: unix connect to /var/run/BackupPC/BackupPC.sock: No such file or directory.
    Perhaps the BackupPC server is not running or there is a configuration error. Please report this to your Sys Admin.

    However I only created the user with my credentials and did not change the root for RsyncSshArgs.

    Any ideas, what is going on here?


      • koromicha!
        Yes I manage to install again, and now the backuppc is runing. But I have another problem, when I try to make 1st backup, nothing happens. The log says it can’t find the Log file. Completely nothing. Any idea ?

        • We are glad you get it running.
          In regards to running backup, are you able to connect to the remote host via ssh as backup user without password?

          • koromicha yes! I monitor the connection on remote router and with only Rsync command I am able to connect and give a command to transfer files. But when I start Backup in Backup PC nothing happens. I installed BPC, and reinstalled again, but when I click Start Backup, nothing happens :\ What might this be. In 3.x version I was always getting Log file and errors, but here even Log file does not get created, nothing. This is really strange! Thanks for any help! I really appreciate it!

          • Ok, so I tried something because my mind was not restful. I created a new virtual machine on Vmware with ubuntu 20.04 server. I installed with following the manuals above. This time I did not change the /var/lib/backuppc/ topdir, and I left it as it is. When I tried to make a backup it went flawlessly.

            But, beacuse my virtual machine is storage limited I tried to change the top dir in Server>Edit Config>TopDir to some other directory. And VOILA! this time I get the same result as in my first try. So, what should I do or better say what permissions should I set when I change Server>Edit Config>TopDir settings??

            The problem is, that I have a freenas located on the newtork that has a lot of space and I don’t know how can I mount or transfer the backup data from BackupPC virtual machine over the network to another local machine? Is there any tutorial for that? Thank you in advance!

          • Hello Tade,
            Did you try to set the user and group ownership of the directory you are using as backuppc storage to backuppc, as in backuppc:backuppc? 755 should work for perms as well

  5. How can I set BackupPC that it can make a backups to lan path? Any Idea? I am running it on virutal machine and it is quiet small, and I cannot use it for backups too.

  6. Dear koromicha, Thank you for these instructions. I followed them on my freshly installed Ubuntu 20.04 machine and the installation (BackupPC-4.4.0 as it was when I did it today) went just well until the step “chmod u-s /var/www/cgi-bin/BackupPC/BackupPC_Admin”, at when it became clear that the entire /var/www/cgi-bin directory was not even there. Do you have an advise on how I can recover from this problem and continue the installation and hopefully get it all working ? Thank you in advance !

  7. I get as far as “apachectl -t” without errors but then one pops up with the /etc/apache2/conf-enabled/BackupPC.conf file on line 9

    Any suggestions?


Leave a Comment