
Setting up a reliable backup system is crucial for any server or workstation. BackupPC is a powerful, open-source backup software package that offers a highly efficient way to back up computers. It uses advanced pooling and compression techniques to reduce disk space usage significantly. This guide will walk you through the process of installing and configuring BackupPC on a Debian 10 system, turning it into a dedicated backup server.
Before you begin, ensure you have root or sudo privileges on your Debian 10 machine. An internet connection is also required to download the necessary packages.
Installation Steps
The installation process for BackupPC on Debian 10 is straightforward using the apt package manager.
First, update your package lists to ensure you get the latest version information:
sudo apt update
Now, install the BackupPC package and its dependencies. This command will fetch and install the main BackupPC application, along with essential components like the Apache web server and Perl modules it relies on.
sudo apt install backuppc
During the installation, you might be prompted to configure postfix or another mail server. This is used for sending backup reports. You can choose the option that best suits your needs, or configure it later if unsure.
You will also likely be asked if you want to configure the web server for BackupPC. Choose “yes” to enable access via a web browser.
Initial Configuration
BackupPC’s main configuration file is located at /etc/backuppc/config.pl
. This file contains numerous settings that control how BackupPC operates, including where backups are stored, email settings, and default backup parameters.
The default installation often places backups in /var/lib/backuppc
. Ensure the partition containing this directory has enough space for your backups. You can change the $TopDir
setting in config.pl
if you need to store backups elsewhere, for example, on a larger dedicated drive.
For basic operation, the default settings in config.pl
are often sufficient. However, you will need to configure specific hosts (clients) that you want to back up. This is done through the web interface, which we will set up next.
Accessing the Web Interface
The BackupPC web interface is essential for managing hosts, viewing backup status, and configuring individual backup jobs. It’s typically accessed via a web browser on the BackupPC server’s IP address or hostname.
By default, the web interface is often configured under the alias /backuppc
. You can access it by navigating to http://your_server_ip_or_hostname/backuppc
.
You will be prompted for a username and password. The default user is backuppc
. To set or change the password for this user, you’ll use an Apache utility. The password file is usually located at /etc/backuppc/htpasswd
.
Use the following command to create or update the password for the backuppc
user:
sudo htpasswd /etc/backuppc/htpasswd backuppc
You will be asked to enter and confirm the new password.
After setting the password, refresh your web browser and log in using the username backuppc
and the password you just set.
Securing the Web Interface
It is strongly recommended to secure access to your BackupPC web interface, especially if it’s accessible from outside your local network. You can achieve this by configuring Apache for SSL/TLS (HTTPS). This involves obtaining an SSL certificate (you can use Let’s Encrypt for free certificates) and configuring Apache to use it for the /backuppc
location.
Adding Hosts for Backup
Once logged into the web interface, you can begin adding clients (hosts) to back up. Navigate to the “Edit Config” menu and then “Hosts”. Here, you can add new hosts by specifying their hostname or IP address and the method to use for backup (e.g., Rsync, SMB, Tar over SSH).
For Rsync backups, you’ll typically configure SSH key-based authentication for the backuppc
user on the server to log into the client machines without a password.
Conclusion
Installing and configuring BackupPC on Debian 10 provides a robust and efficient solution for your backup needs. By following these steps, you can set up a central backup server to protect data from multiple client machines. Remember to regularly check backup logs and test restores to ensure your data is safe and recoverable. BackupPC’s flexibility and feature set make it an excellent choice for managing backups in diverse environments.
Source: https://kifarunix.com/install-and-configure-backuppc-on-debian-10/