Fix "permission denied" and file ownership errors
“Permission denied”, a blank white page, uploads that fail, a 500 error after copying files in — almost always a file permission or ownership problem.
How web permissions work
Two things decide whether the web server can read your files:
- Ownership — which user/group owns the file. Your site’s files should be owned by the user the site runs as.
- Mode — the read/write/execute bits, written like
644or755.
The safe, standard values for a website:
| Thing | Mode | Meaning |
|---|---|---|
| Files | 644 | owner read/write, others read |
| Folders | 755 | owner read/write/enter, others read/enter |
A secret file (e.g. .env) | 600 | owner only |
Fixing it
Easiest: use the File Manager, which creates files as the correct user automatically — so uploads and extracts “just work”. If you’re in the terminal:
# fix modes (run inside the site's folder)find . -type f -exec chmod 644 {} \;find . -type d -exec chmod 755 {} \;Never use 777
Setting 777 (“everyone can do anything”) is the classic bad fix. It makes the
error go away and makes the file world-writable — a real security hole that
malware loves. If 777 “fixes” it, the real problem is ownership — the file
is owned by the wrong user. Re-upload through the File Manager, or correct the
owner.
Still stuck?
- Uploaded via FTP as the wrong user? Re-upload through the File Manager.
- App can’t write a cache/upload folder? That folder (only) may legitimately
need to be writable by the app — set it, but keep everything else at
644/755.
Running OrbixPanel? The File Manager sets ownership correctly for you. OrbixPanel.com → — the free, self-hosted, AI-powered hosting control panel.