LinuxCommandLibrary

kopia

Backup and restore files and directories

TLDR

Create a repository in the local filesystem

$ kopia repository create filesystem --path [path/to/local_repository]
copy

Create a repository on Amazon S3
$ kopia repository create s3 --bucket [bucket_name] --access-key [AWS_access_key_id] --secret-access-key [AWS_secret_access_key]
copy

Connect to a repository
$ kopia repository connect [repository_type] --path [path/to/repository]
copy

Create a snapshot of a directory
$ kopia snapshot create [path/to/directory]
copy

List snapshots
$ kopia snapshot list
copy

Restore a snapshot to a specific directory
$ kopia snapshot restore [snapshot_id] [path/to/target_directory]
copy

Create a new policy
$ kopia policy set --global --keep-latest [number_of_snapshots_to_keep] --compression [compression_algorithm]
copy

Ignore a specific file or folder from backups
$ kopia policy set --global --add-ignore [path/to/file_or_folder]
copy

SYNOPSIS

kopia [global-options] <command> [args]
Examples:
kopia repository create location
kopia snapshot create /path/to/backup

PARAMETERS

-h, --help
    Show context-sensitive help

--log-level string
    Set logging level (error, warning, info, debug)

--log-file string
    Log output to specified file

--server-url string
    Kopia server URL for remote access

--user string
    Username for repository/server (default: anonymous)

--password string
    Password (prompts if omitted)

--password-file string
    Read password from file

--password-stdin
    Read password from stdin

--repo-password string
    Repository master password

--repo-password-file string
    Read repo password from file

--repo-password-stdin
    Read repo password from stdin

--config-file string
    Path to config file (default: ~/.config/kopia/config.json)

--server-cert string
    TLS cert for server verification (mTLS)

--version
    Print version information

DESCRIPTION

Kopia is a fast and secure open-source backup/restore program for Linux, Windows, and macOS. It features client-side end-to-end encryption, deduplication, and compression to efficiently store snapshots with minimal space. Kopia uses a content-addressable storage model for data integrity and rapid operations.

Key capabilities include incremental backups, powerful policy management for automation, virtual filesystem mounting of snapshots, and server mode for fast network backups. It supports diverse backends: local filesystems, SFTP, Rclone remotes, and clouds like AWS S3, Google Cloud Storage, Backblaze B2, and Azure Blob.

Designed for modern hardware, Kopia leverages parallelism for high throughput. Snapshots are immutable and verifiable. The tool is a single Go binary, dependency-free, with a focus on usability via CLI, GUI companion, and API.

CAVEATS

Requires repository initialization before snapshots. Manage passwords securely as data is encrypted client-side. Large initial backups may take time due to scanning.

MAIN SUBCOMMANDS

repository: Manage storage repos.
snapshot: Create/list/restore snapshots.
policy: Define backup rules.
mount: Mount snapshots as FUSE filesystem.
server: Run backup server.
Use kopia help <command> for details.

QUICK START

1. kopia repository create location --password
2. kopia snapshot create /path
3. kopia snapshot list

HISTORY

Developed by Michał Łowicki, first public release in 2017. Actively maintained on GitHub with frequent updates focusing on performance, cloud support, and UI tools. Gained traction as a modern restic alternative.

SEE ALSO

restic(1), borg(1), rsync(1), duplicity(1)

Copied to clipboard