Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the critical files I need to backup from gpg? I guess my private key would qualify of course... but what else?

share|improve this question
Thanks to all for taking the time to reply! – jldupont Nov 19 '09 at 14:40
up vote 9 down vote accepted

The most critical are your secret/private keys:

gpg --export-secret-keys > secret-backup.gpg

secret-backup.gpg is then the file to keep safe.

Otherwise the ~/.gnupg/ directory contain all private and public keys(secring.gpg and pubring.gpg respectively) as well as configuration and trustdb which could be convenient to have stored.

share|improve this answer

The easiest way would be to grab the entire GnuPG directory - usually ~/.gnupg/, it contains all the keys you have.

share|improve this answer

You definitely want to backup your private key and the revocation file you created.

share|improve this answer
where is the "revocation certificate" ? – jldupont Nov 18 '09 at 22:07
You need to create it (if you didn't already). It is used to revoke your key if you loose your private key. – PEra Nov 24 '09 at 18:17

You may also want to back up any keys you've signed or ones you don't feel like re-downloading off the key servers.

At a minimum, all you need is your complete key.

share|improve this answer
...and any revocation certificates you created. – Broam Nov 18 '09 at 22:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.