Skip to main content

Setting up backups with Kopia (CLI & GUI)

Kopia is a cross-platform, open-source backup tool featuring client-side encryption, deduplication and compression. It is available as a command-line tool (kopia) and with a graphical user interface (KopiaUI) – both use the same repository format.

Prerequisites

  • S3 credentials and a Bucket, e.g. kopia-backups
  • Kopia or KopiaUI installed (Download)
Repository password

Both options require a repository password, which is used to encrypt all the data. Without this password, recovery is not possible.

Option A: Command line (kopia)

Create and connect a repository

kopia repository create s3 \
--bucket=kopia-backups \
--endpoint=s3.internet1.de \
--access-key=IHR_ACCESS_KEY \
--secret-access-key=IHR_SECRET_KEY
# → Repository-Passwort festlegen

# Auf weiteren Rechnern mit bestehendem Repository verbinden:
kopia repository connect s3 \
--bucket=kopia-backups \
--endpoint=s3.internet1.de \
--access-key=IHR_ACCESS_KEY \
--secret-access-key=IHR_SECRET_KEY

Creating and managing snapshots

kopia snapshot create /home/benutzer/dokumente

kopia snapshot list # Snapshots anzeigen
kopia ls -l k<snapshot-id> # Inhalt eines Snapshots

Restore

kopia restore k<snapshot-id> /tmp/restore

# Einzelne Datei über den Mount-Modus holen
kopia mount all /mnt/kopia &
cp /mnt/kopia/<pfad>/datei.txt ~/wiederhergestellt.txt
umount /mnt/kopia

Retention Policy

kopia policy set /home/benutzer/dokumente \
--keep-latest 10 --keep-daily 7 --keep-weekly 4 --keep-monthly 6

Data that is no longer required is automatically deleted during regular maintenance (kopia maintenance run --full can be run manually if necessary).

Automation

# Beispiel-Cronjob: tägliches Backup um 02:00 Uhr
0 2 * * * /usr/local/bin/kopia snapshot create /home/benutzer/dokumente

Option B: Graphical user interface (KopiaUI)

  1. Launch KopiaUI.
  2. When launching for the first time, select Set up repository and choose Amazon S3 & compatible as the storage type.
  3. Enter the connection details:
    • Bucket: kopia-backups
    • Server/Endpoint: s3.internet1.de
    • Enter Access Key / Secret Key
  4. Set a repository password (or enter the existing one if the repository already exists).
  5. Use New Snapshot to select the folders to be backed up and start the first snapshot.
  6. Under Policies, configure retention, schedule (e.g. daily), compression and exclusions.

Restore: Click on the snapshot in the list, navigate through the directory tree, use Restore to write files/folders back to a destination path, or mount the snapshot as a drive.

Notes

  • CLI and KopiaUI can use the same repository – even from different computers.
  • Kopia performs global deduplication within the repository: identical data blocks from multiple computers are stored only once.
  • By default, the connection is made via TLS; the password never leaves the client.