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

Is there any standard or convention for where SSL certificates and associated private keys should go on the UNIX/Linux filesystem?


share|improve this question

3 Answers 3

up vote 21 down vote accepted

For system wide use OpenSSL should provide you /etc/ssl/certs and /etc/ssl/private. The latter of which will be restricted 700 to root:root.

If you have an application not performing an initial privsep from root then it might suit you to locate them somewhere local to the application with the relevantly restricted ownership and permissions.

share|improve this answer
I have indeed, thanks Dan. – John Topley Sep 4 '09 at 16:11
is this standardized somewhere? The file system hierarchy standard doesn't contain it. – cweiske Dec 4 '13 at 20:50
@cweiske This seems to be historical OpenSSL convention, not formally standardized, and a very unwieldy one in my opinion. My earliest trace is this version:… – kubanczyk Apr 2 at 21:20
Worth noting that this is only Debian based distros. – GMambaG Sep 16 at 8:23

This will vary from distribution to distribution. For example, on Amazon EC2 Linux instances, the certificates are stored in /etc/pki/tls/certs and the keys are stored in /etc/pki/tls/private. The CA certificates have their own directory, /etc/pki/CA/certs and /etc/pki/CA/private. For any given distribution, especially on hosted servers, I recommend to follow the already-available directory structure, if one is available.

share|improve this answer
This is for RHEL based distributions, not just EC2 – GMambaG Sep 16 at 8:22

This is where Go looks for public root certificates:

"/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt",   // Fedora/RHEL
"/etc/ssl/ca-bundle.pem",             // OpenSUSE
"/etc/pki/tls/cacert.pem",            // OpenELEC


"/system/etc/security/cacerts", // Android
share|improve this answer

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.