GnuPG and OpenPGP guides: install, keys, encrypt and sign

Updated November 2026

These guides show you how to use OpenPGP today with GnuPG (the gpg command) and the programs built on it. The commands have been checked against the GnuPG manual and tested with GnuPG 2.4 or 2.5, and each guide says what output to expect.

Start here

If you are new to PGP, work through these four steps in order. At the end you can encrypt, sign and verify files, and other people can find your public key.

  1. Install GnuPG. Most Linux systems already have it. On Windows install Gpg4win, and on macOS use GPG Suite or Homebrew. Then run gpg --version to see which version you have.
  2. Create your key pair. One command, gpg --full-generate-key, makes a modern Curve 25519 key. Choose an expiry date and a good passphrase, and keep the revocation certificate that GnuPG saves for you.
  3. Publish your public key. Upload it to keys.openpgp.org and confirm your email address, or publish it on your own domain with a Web Key Directory. Then people can find it by your email address.
  4. Encrypt and sign. Encrypt files for a person or with a passphrase. Sign files and check signatures so people can tell a file came from you and was not changed.

After that, two guides cover everyday tasks: checking that downloaded software is genuine, using the Debian installer and GnuPG itself as real examples, and encrypted email in Thunderbird, Outlook, Apple Mail, Android and Proton Mail.

Which GnuPG version? As of November 2026 the stable GnuPG branch is 2.5 (latest release 2.5.24). The 2.4 branch reached end of life on June 30, 2026, but many Linux distributions still ship 2.4 with their own security fixes. The commands in these guides work the same on 2.4 and 2.5 unless a guide says otherwise.

How the guides work

All guides

The full list, including keys on smartcards, backups, APT repository keys, Git signing, the OpenPGP standards and the history of PGP:

More help

If a command fails, look in common problems. It covers errors such as “No public key”, “Unusable public key” and passphrase prompts that never appear. To understand how keys, fingerprints and signatures fit together, read how PGP works. To find someone’s public key, try the key lookup.

Sources