How To Create A GPG key

In this documentation article we’ll help you to create a new GPG key. BeepBackup uses GPG keys to securely encrypt your backups.

Prerequisites

To follow this tutorial you will need:

  1. Some basic affinity with the terminal.
  2. The GPG command line tools installed on your system. Download them at GnuPG if necessary.

Generate the GPG key

  1. Open a terminal.
  2. To generate a new key run gpg --full-generate-key (see docs). This will prompt you for every available option.
  3. Specify the kind of key you want, or press Enter to accept the default.
  4. Specify the key size you want, or press Enter to accept the default.
  5. Enter the length of time the key should be valid. Press Enter to specify the default selection, indicating that the key doesn’t expire.
  6. Double-check everything you’ve entered is correct.
  7. Enter your user ID information as prompted by the program.
  8. Type a secure passphrase. You will need this passphrase when using the key later.
    Please note: a secure passphrase is not a substitute for keeping your private key safe! Never share your private key with others.
  9. Use gpg --list-secret-keys (see docs) to list the long form of the GPG keys for which you have both a public and private key.
  10. From the list of GPG keys, copy the long form of the GPG key ID you’d like to use. In this example, the GPG key ID is 12345678ABCDEFGH:
    $ gpg --list-secret-keys --keyid-format=long
    /Users/beep/.gnupg/secring.gpg
    ------------------------------------
    sec   ed25519/12345678ABCDEFGH 2025-05-24 [expires: 2028-05-23]
    uid                            BeepBackup <info@beepbackup.com>
    ssb   ed25519/XXXXXXXXXXXXXXXX 2025-05-24
  11. Now that you’ve generated the key, and found the key id, you can use it to view your public key. Run gpg --armor --export 12345678ABCDEFGH to view the public key.
  12. You now see your public key, starting from -----BEGIN PGP PUBLIC KEY BLOCK----- and including -----END PGP PUBLIC KEY BLOCK----- at the end.

Great! Your new key pair is ready for use.

Next Steps

Now that you’ve generated a keypair that can be used to securely encrypt your backups, let’s head over to How To Import Encryption Keys to import your newly created key in BeepBackup.

Need help with this topic?

If you're having trouble with this documentation or need additional assistance, we're here to help.