What Is fullchain.pem and How to Use It
If you have used Certbot, you have seen four files with similar names: privkey.pem, cert.pem, chain.pem and fullchain.pem. Most servers need only two of them. Picking the wrong certificate file is a common reason for a site that works in your browser but fails in an app, a phone or a command line tool. This page explains what each file holds, based on the Certbot documentation, and how to check what you have.
What is inside fullchain.pem
Certbot's documentation says fullchain.pem contains all certificates, including the server certificate, also called the leaf or end-entity certificate. The server certificate comes first in the file, followed by any intermediates. It is plain text in PEM format, so you can open it and see several blocks that each start with -----BEGIN CERTIFICATE-----.
The root certificate is not included. Clients already have trusted roots in their own stores. See what an SSL certificate chain is for how leaf, intermediate and root fit together.
The four files compared
| File | Contains | Give it to your server? |
|---|---|---|
privkey.pem | The private key | Yes, as the key. Keep it secret |
fullchain.pem | Leaf plus intermediates | Yes, as the certificate |
cert.pem | The leaf only | Only together with chain.pem |
chain.pem | The intermediates only | Only together with cert.pem |
Certbot says that if you provide cert.pem or chain.pem to your web server, you must provide both, or some browsers will show a "This Connection is Untrusted" error some of the time. The easy rule is to use fullchain.pem and avoid the issue.
Which directive takes which file
Certbot's documentation states what each server needs:
- Nginx:
fullchain.pemforssl_certificateandprivkey.pemforssl_certificate_key. - Apache 2.4.8 or later:
fullchain.pemforSSLCertificateFileandprivkey.pemforSSLCertificateKeyFile. - Apache older than 2.4.8:
cert.pemforSSLCertificateFileandchain.pemforSSLCertificateChainFile.
# folder: /etc/letsencrypt/live/example.com/
ssl_certificate .../fullchain.pem;
ssl_certificate_key .../privkey.pem;
With OCSP stapling in Nginx 1.3.7 or later, Certbot says chain.pem is what you pass as ssl_trusted_certificate. Let's Encrypt has since stopped OCSP, as covered in the OCSP shutdown guide.
Where the files live
Certbot puts them in /etc/letsencrypt/live/NAME/, where NAME is the certificate name. Certbot says to point your server configuration directly at those files instead of copying them, and that /etc/letsencrypt/live is updated with the latest files during renewal. Do not copy the files to another place by hand, or you will serve an old certificate after the next renewal. Reload the server after a renewal so it reads the new file.
How to check a file
Count the certificates in the file and read their subjects:
grep -c "BEGIN CERTIFICATE" fullchain.pem
openssl crl2pkcs7 -nocrl -certfile fullchain.pem |
openssl pkcs7 -print_certs -noout
A normal Let's Encrypt file gives a count of 2 or more, with the leaf first. If the count is 1, you have the leaf only, like cert.pem. To test the live server instead, run the free SSL chain checker or openssl s_client -connect example.com:443 -showcerts.
Build your own fullchain file
If a CA sends the leaf and the intermediate in separate files, join them with the leaf first:
cat example.com.crt intermediate.crt > fullchain.pem
The order matters. Putting the intermediate first makes many servers send a broken chain. If your server wants a PFX or JKS instead, see the PEM to PFX guide and the PEM to Java keystore guide.
Other clients
lego writes example.com.crt and example.com.key. Its documentation says the .crt already includes the CA certificate, so it can be used as a full chain file. See the ACME client comparison for what each client names its files.
Common mistakes
- Using
cert.pemalone: works in some browsers, fails in others. - Putting
fullchain.pemwhere a private key belongs: the server will not start. - Copying the files elsewhere by hand: the copy goes stale at the next renewal.
Source: Certbot documentation, "Where are my certificates?" and lego documentation.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.