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
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)
- Launch KopiaUI.
- When launching for the first time, select Set up repository and choose Amazon S3 & compatible as the storage type.
- Enter the connection details:
- Bucket:
kopia-backups - Server/Endpoint:
s3.internet1.de - Enter Access Key / Secret Key
- Bucket:
- Set a repository password (or enter the existing one if the repository already exists).
- Use New Snapshot to select the folders to be backed up and start the first snapshot.
- 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.