---
name: "borg-key-import"
section: "1"
platform: "linux"
package: "borg"
version: "1.4.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/borg-key-import"
---

# borg-key-import(1)

Import the repository key from backup

## Name

borg-key-import - Import the repository key from backup

## SYNOPSIS

borg \[common options\] key import \[options\] \[REPOSITORY\] \[PATH\]

## DESCRIPTION

This command restores a key previously backed up with the export command.

If the **--paper** option is given, the import will be an interactive process in which each line is checked for plausibility before proceeding to the next line. For this format, PATH must not be provided.

For repositories using keyfile encryption, the key file which **borg key** **import** writes to depends on several factors. If the **BORG\_KEY\_FILE** environment variable is set and non-empty, **borg key import** creates or overwrites the file named by **$BORG\_KEY\_FILE**. Otherwise, **borg** **key import** searches in the **$BORG\_KEYS\_DIR** directory for a key file associated with the repository. If a key file is found in **$BORG\_KEYS\_DIR**, **borg key import** overwrites it; otherwise, **borg** **key import** creates a new key file in **$BORG\_KEYS\_DIR**.

## OPTIONS

See *[borg-common(1)](/borg-common/1.md)* for common options of Borg commands.

### arguments

REPOSITORY

- **PATH**

  path to the backup ('-' to read from stdin)

### options

- **--paper**

  interactively import from a backup done with **--paper**

## EXAMPLES

This command can be used to create a related repository:

## SEE ALSO

*[borg-common(1)](/borg-common/1.md)*, *[borg-key-export(1)](/borg-key-export/1.md)*

## Author

The Borg Collective
