Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Setting laravel storage permissions with linux ACL's

Hi everybody, I'm fed up with resetting folder permisssions each time I use git to deploy or pull some changes from a repository or each time new files are added to my laravel application in my production VPS (DigitalOcean). Because of this I recently strted reading about linux's ACL which afaik are like permisssions on steroids.

My plan is to deploy with git using sudo, then chown the app folder to my user, after thad I would add my user to www-data group (this is the web server afaik?) so that I can edit and ftp files without using sudo, after that I want to use this command:

sudo setfacl -d -R -m u:$USER:rwx,g:www-data:rwx,o:rx /var/www/laravel-app-folder

Afaik this command will set permissions (and default permisssions for future directories/files created under this app folder) while giving the web server write access to storage folder in order to avoid future errors.

Is this a good approach? I'm open to all kinds of suggestions.

0 likes
2 replies
Gabotronix's avatar

Is using ACL considered a good practice? having to reassign permissions each time I use git seems a bit lame

1 like

Please or to participate in this conversation.