Getty Images

Get started with the Kopia backup tool

Backup applications have evolved for increased speed, flexibility and new storage locations. Open source tool Kopia is one option backup admins might consider.

Backups are a critical part of system management. Kopia is a flexible and affordable option backup admins might consider.

While backup applications have continued to evolve for increased speed, flexibility and new storage locations, many basic features remain the same. Kopia is one example of a well-evolved open source backup tool. The application uses policy-based backups and cloud storage. It provides cross-platform support for Linux, macOS and Windows environments. There are several ways for users to automate Kopia's installation, configuration settings and backup policies.

The Kopia backup process consists of three primary steps:

  1. Create snapshots of defined directories and files.
  2. Encrypt the snapshot on the local system.
  3. Upload the encrypted snapshot to the designated repository.

Policies govern what data it backs up and where it is stored. They also manage backup frequencies, retention settings, encryption and compression. Policies enable users to exclude directories or files from being backed up. Users can administer Kopia from a graphical console or the command line. Repositories use passwords for access control.

Kopia backups are incremental, meaning the backup job runs quickly because it only copies changed resources. This is a common feature among backup utilities. Data deduplication and compression help streamline the process even more by only backing up a single instance of a resource and compressing the data where possible.

Kopia documentation points out that backup encryption is end-to-end to protect the data in-transit from inside the source computer to inside the storage location.

Learn more about installing Kopia, including a tutorial for backup and basic use.

How to install Kopia

Your first decision around Kopia's installation is if you intend to manage it via the CLI or the GUI. The program is the same; the GUI is just a wrapper for the CLI version. However, there are separate installers for each.

Install on Linux

Various Linux distributions rely on different package managers. Kopia offers broad Linux support for Red Hat package managers (RPMs), including Red Hat Enterprise Linux and Fedora. It also supports Debian, Ubuntu and Linux Mint.

On Red Hat-derived distributions using RPM, type these commands to download the GPG key, configure the necessary yum repository, and install Kopia:

$ sudo rpm --import https://kopia.io/signing-key
$ sudo cat <<EOF | sudo tee /etc/yum.repos.d/kopia.repo
[Kopia]
name=Kopia
baseurl=http://packages.kopia.io/rpm/stable/\$basearch/
gpgcheck=1
enabled=1
gpgkey=https://kopia.io/signing-key
EOF
$ sudo yum install kopia
$ sudo yum install kopia-ui

On Debian-based distributions using apt, type the following commands to download the GPG key, register the package source, and install Kopia:

$ curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /etc/apt/keyrings/kopia-keyring.gpg
$ echo "deb [signed-by=/etc/apt/keyrings/kopia-keyring.gpg] http://packages.kopia.io/apt/ stable main" | sudo tee /etc/apt/sources.list.d/kopia.list
$ sudo apt update
$ sudo apt install kopia
$ sudo apt install kopia-ui

Check the Kopia installation guide for information on installing the program on Arch and Manjaro Linux. Kopia also supports open source operating systems FreeBSD and OpenBSD.

Install on macOS

Installing Kopia on macOS systems begins with the Homebrew package manager. This tool has you run a single command to install the CLI package:

$ brew install kopia

If you want the GUI package, run this command instead:

$ brew install kopiaui

Use the brew upgrade kopia or brew upgrade kopiaui commands to update existing installations.

Install on Windows

Kopia relies on the Windows Scoop Package Manager, so install that first. Once installed, use the scoop command to get the CLI Kopia package.

> scoop bucket add kopia https://github.com/kopia/scoop-bucket.git
> scoop install kopia

The GUI version includes a desktop application for easy management. A web-based interface is only available if you deploy Kopia in server mode.

Back up data

The first step in backing up content with Kopia is defining a repository. Repositories are storage locations for backup jobs. Kopia enables users to select their preferred repository location from several storage options, including the following:

  • Local system.
  • Network-attached storage.
  • Central server configured as a Kopia repository.
  • AWS S3 Cloud Storage.
  • Azure Blob Storage.
  • Google Cloud Storage.
  • Google Drive.

Kopia enables target repositories that support WebDAV and SFTP connections, as well as Docker container images.

Screenshot of storage type options for a repository.
Figure 1. Define a storage repository.

Check Kopia's repository documentation for details on setting up each repository since the steps vary by target. Repositories are password protected, and you cannot recover information from the repository without the password.

Screenshot of user setting a repository password.
Figure 2. Set a repository password.

The following commands create a repository and then connect to it:

$ kopia repository create {target-provider} {flags}
$ kopia repository connect {target-provider} {flags}

Once you set the repository, create a policy that defines which directories and files you want to back up. Kopia's command-line version includes subcommands for flexible settings.

Policies also govern compression, scheduling and retention settings for backup jobs.

Screenshot of repository policies.
Figure 3. Examine the repository and related policies.

The screenshot in Figure 4 displays some of the available global policy settings.

Screenshot of Global policy settings.
Figure 4. Sample Global policy categories, including scheduling, compression and logging.

For example, the Scheduling entry enables you to set snapshot frequency and time of day, among other options.

Screenshot of scheduling section under Global policy settings.
Figure 5. The Scheduling section.

You can also manually create snapshots using the Snapshots tab. I configured a manual snapshot of the /var directory in the example shown in Figure 6.

Screenshot of user creating a new snapshot.
Figure 6. Create snapshots manually or automatically.

How to restore data

Users have three options for restoring data using Kopia:

  • Restore all files to the specified location.
  • Restore selected files to the specified location.
  • Mount the backup as a disk on the local system and browse for the directories and files you need to restore.

Begin the restore process by selecting the snapshot you want to restore from.

Screenshot displaying snapshots to restore from.
Figure 7. Select a snapshot to restore from.

You can mount the snapshot and browse its contents to choose specific directories and files to restore. You can also simply restore all resources.

Screenshot of snapshot and other files the user can restore.
Figure 8. Mount the snapshot or browse it to select exactly what to restore.

Kopia prompts you for a destination path for where to restore the resources.

Screenshot of restore destination and security settings.
Figure 9. Define a restore destination and other critical security settings.

Note the options that might lead to data exposure or loss, such as overwrite, permissions and owner settings.

Restoring resources from the Kopia CLI is straightforward. The basic command is as follows:

$ kopia restore {target-source}

Specify additional options and destinations depending on your requirements.

For additional help and ways to use the application, reference Kopia's official documentation.

Damon Garn owns Cogspinner Coaction and provides freelance IT writing and editing services. He has written multiple CompTIA study guides, including the Linux+, Cloud Essentials+ and Server+ guides, and contributes extensively to TechTarget Editorial and CompTIA Blogs.

Dig Deeper on Data backup and recovery software

Disaster Recovery
Storage
ITChannel
Close