Linux

Where Is the GnuPG Home Directory?

GnuPG ~/.gnupg folder with keyrings, trust database and agent config on Linux.

Last updated

GnuPG keeps keyrings, trust database, agent sockets and config in .gnupg in your home directory. Private keys live here encrypted by your passphrase, which makes the folder backup-critical and leak-sensitive at once.

Permissions must stay strict or gpg refuses to run. Copy the folder to migrate identity and re-verify trust on the new machine.

Where Linux stores this, by platform

Linux
~/.gnupg

Holds pubring.kbx and private-keys-v1.d with key material, trustdb.gpg for ownertrust, plus gpg.conf and gpg-agent.conf. Keep permissions at 700 with keys at 600 or gpg errors out. Back up offline and guard it like credentials.

Frequently asked questions

How do I move GPG keys to a new machine?

Copy the .gnupg folder above with correct permissions, or export public and secret subkeys properly. Verify fingerprints after the move.

Why does GPG complain about permissions?

The home folder above is group- or world-readable. Chmod it to 700 and keys to 600, then retry.

Notice an outdated path? Let us know.