permission SSL / TLS Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

nginx: [emerg] cannot load certificate key: BIO_new_file() failed (Permission denied) / open() failed (13: Permission denied)

nginx can't read the private key or certificate file, so it refuses to start or reload.

Exact message you may see nginx: [emerg] cannot load certificate key: BIO_new_file() failedBIO_new_file() failed (SSL: error:0200100D:system library:fopen:Permission deniedopen() "/etc/ssl/private/example.key" failed (13: Permission denied)cannot load certificate "/etc/...": BIO_new_file() failednginx ssl key permission denied
Seen on: Nginx Linux SSL

Meaning

Fix ownership and mode: keys readable by root (nginx master reads them as root, so check parent directory permissions and SELinux/AppArmor contexts too). Don't make keys world-readable. Check the full path (every directory needs x), and symlink targets such as Let's Encrypt's archive/.

Common causes

  • Wrong file mode/ownership on the key
  • Parent directory not traversable
  • SELinux/AppArmor blocking
  • Symlink target in archive/ unreadable
  • Key on a mount with noexec/ACL restrictions

⚡ Quick fix

  1. ls -l along the path and fix permissions
  2. chmod 640 and chown root:ssl-cert (or similar)
  3. Check SELinux: restorecon -Rv /etc/ssl

Detailed fix by platform

Shell

  1. bash
    namei -l /etc/letsencrypt/live/example.com/privkey.pem
    sudo nginx -t

How to diagnose

  1. Path — Traversable?
  2. Mode/owner — Correct?
  3. SELinux — Blocking?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

0x80070005 — Windows Error 0x80070005 (E_ACCESSDENIED): Access is denied (Windows)0x80070005403 — HTTP 403 Forbidden (HTTP)403405 — 405 Not Allowed when POSTing to a static page or file (nginx) (HTTP)405414 Request-URI Too Large / 400 Request Header Or Cookie Too Large — Nginx: 400 Bad Request — Request Header Or Cookie Too Large / client sent too long header line (Nginx / Apache)414 Request-URI Too L…494 — nginx 494 Request Header Or Cookie Too Large (HTTP)494499 Client Closed Request / client prematurely closed connection — Nginx: [info] client prematurely closed connection while reading response header from upstream / access log status 499 (Nginx / Apache)499 Client Closed Req…AADSTS65001 — AADSTS65001: The user or administrator has not consented to use the application (Azure)AADSTS65001accept4() failed (24: Too many open files) — Nginx: [crit] accept4() failed (24: Too many open files) / open() failed (24: Too many open files) (Nginx / Apache)accept4() failed (24:…permission

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.