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

jmason81's avatar

Laravel Forge and Storage Directory Permissions

I'm using Laravel Forge, and I'm writing files to the Storage directory. My users are uploading files, and then the application is getting the file from storage and writing it to an external service.

The first file I uploaded when I first deployed worked fine, but then the next time it said it couldn't find the file. I SSH'd in to my server and I see the file, but it has -rw-r--r-- permissions. I ran chmod -R 775 storage and then re-ran the operation and there was no error, and all the files in the folder were changed to rwx.

However, the next time I uploaded a file, it's permissions were set to rw-r--r-- like the others originally were, so the chmod command I ran apparently isn't applied to new files.

Also, from what I've read I want storage to be 755 and the files within the storage directory to be 644. From what I understand I need to change the umask setting, but from what I show it's already 0002 as default, which I think should be 644 for files. i'm very confused and not super familiar with the whole file permissions thing. It also doesn't help that there are like 8 different ways to refer to the file permissions.

How can I set my storage directory to where any newly uploaded files will be able to be downloaded by whatever user Forge is running my site under? I'm assuming this is the Forge user, but I've also read in the docs that they create a separate user for each site, so I'm confused as to exactly how to do this.

I'm running Ubuntu 20.04.

Thanks!

0 likes
2 replies
jmason81's avatar

Still struggling with this. I've tried to add an ACL, which seems to have been added successfully, but still no change in how files are created. I ran setfacl -m "u:forge:rwx" storage and setfacl -m "g:forge:rwx" storage. The storage directory seems to have been modified, but adding a file to it doesn't do anything.

Please or to participate in this conversation.