Resolving 'Permission Denied' Errors in Ghost CMS Content Directories
Fix 'Permission Denied' and EACCES errors in Ghost CMS by diagnosing and correcting ownership of the /content directory. Avoid the security risks of chmod 777.
03 Jan 2026, 08:55 UTC

The Problem: EACCES and Permission Denied
When attempting to upload a new theme via the Ghost Admin panel or running a ghost install, you may encounter a "Permission Denied" error or a Node.js EACCES exception. This prevents the CMS from writing new files to the disk, effectively locking your site's design and media library.
The root cause is almost always a mismatch between the Linux user owning the /content directory and the user executing the Ghost process. This typically happens if the Ghost CLI was accidentally run as the root user, causing new directories to be created with root-level ownership that the ghost system user cannot modify.
Diagnostic Matrix
| Symptom | Likely Cause | Diagnostic Command |
|---|---|---|
| Theme upload fails with "Permission Denied" | /content/themes owned by root |
ls -la content/themes |
ghost install fails during setup |
Installation folder owned by root | ls -ld /var/www/ghost |
| Images fail to upload to the gallery | /content/images lacks write access |
ls -ld content/images |
Step-by-Step Resolution
Follow these checks in order. Do not skip to the fix without verifying the ownership first.
1. Identify the Current Owner
Navigate to your Ghost installation directory (e.g., /var/www/ghost) and check the ownership of the content folder. Run this command as a user with sudo privileges:
ls -la /var/www/ghost/content
Expected Result: The files should be owned by the ghost user (or the specific non-root user you created during installation). If you see root root, the permissions are incorrect.
2. Correct Ownership
To restore access, you must change the ownership of the entire installation directory back to the ghost user. Replace ghost:ghost with your specific user and group if they differ.
Run this command from the terminal:
sudo chown -R ghost:ghost /var/www/ghost
Risk: Ensure you are targeting the correct path. Running chown -R on a system directory (like /etc or /var) can break your entire operating system.
3. Restart the Ghost Instance
Ownership changes may not be immediately recognized by the running Node.js process. Use the Ghost CLI to restart the service:
ghost restart
Note: This command should be run as the ghost user, not as root.
Verification and Validation
To confirm the fix is active, perform these three checks:
- Directory Check: Run
ls -ld /var/www/ghost/content. The output must show the ghost user as the owner. - Functional Test: Log into the Ghost Admin panel, navigate to Settings → Design, and attempt to upload a
.ziptheme file. A successful upload confirms write access. - Log Audit: Run
ghost log. Look for any remainingEACCESerrors. If the logs are clear of permission errors during the upload attempt, the issue is resolved.
Critical Constraints
- Avoid
chmod 777: Never applychmod -R 777to your Ghost directory. While this "fixes" the error by allowing anyone to read, write, and execute, it creates a severe security vulnerability where any user on the server can modify your site's source code. - Root Execution: Ghost is explicitly designed not to run as root. If you find yourself frequently using
sudo ghost ..., you are likely creating the very permission issues this guide solves.
Escalation Criteria
If the chown command does not resolve the issue, check for these environmental blockers:
- SELinux/AppArmor: On RHEL or Ubuntu, security modules may be blocking write access regardless of ownership. Check
/var/log/audit/audit.logfor denials. - NFS/Network Mounts: If
/contentis mounted on a network drive, the root-squash setting on the NFS server may be overriding local ownership. - Docker Volume Mapping: If running Ghost in Docker, ensure the volume mount in
docker-compose.ymlmaps the correct UID/GID of the container user to the host folder.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.