Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

File permissions

Which directories of a DXP project the web server must write, how to grant it with ACLs so the command line user and the web server can both write, the fallback without ACLs, and what to check when you see "Permission…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/dxp-developers/file-permissions.md

On this page

File permissions

This page is for developers and administrators who set up a DXP project on a server or a workstation. Two users write to the project: you on the command line (php bin/console) and the web server. Both must be able to write the same directories.

Contents

  1. Which directories
  2. With ACLs (recommended)
  3. Without ACLs
  4. Checking
  5. Common mistakes

Which directories

DirectoryWritten byHolds
var/bothSymfony cache, logs, sessions, the SQLite file if you use one
public/var/bothStored files and generated image variations
config/jwt/the command line, onceThe JWT keypair (readable by the web server)

Everything else (src/, config/, templates/, vendor/) is written only when you deploy.

Replace www-data with your web server's user (apache, nginx, _www on macOS):

setfacl -R  -m u:www-data:rwX -m g:www-data:rwX var/ public/var/
setfacl -dR -m u:www-data:rwX -m g:www-data:rwX var/ public/var/

The first line sets the rights on what exists, the second (-d) makes them the default for new files. Install the acl package if setfacl is missing (apt install acl, dnf install acl).

Without ACLs

On file systems without ACLs (some NFS and BSD mounts, macOS APFS):

chown -R www-data:www-data var/ public/var/
chmod -R 775 var/ public/var/

Then add your command line user to the web server's group, or run console commands as that user (sudo -u www-data php bin/console cache:clear).

Checking

getfacl var/ | head                       # the ACL entries
sudo -u www-data touch var/log/.write-test && sudo -u www-data rm var/log/.write-test
ls -l var/data_*.db                       # SQLite: owner and group

Common mistakes

  • Running cache:clear as root. The cache files then belong to root and the web server cannot rewrite them. Run console commands as your normal user or the web server user.
  • Forgetting public/var/. Uploads fail and image variations return errors.
  • Making everything 777. Never needed; use ACLs or the group.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x