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

snake03's avatar
Level 11

Laravel Worker and Storage permissions

Good morning everybody,

I noticed that the Laravel by default creates folder with '755' permission. That means that the user www-data, with Nginx, is the owner of the created folder.

When i setup a worker, this is runned with the system user (user "forge", for example). If I have a job that tries to create a subfolder inside a folder created by Laravel, I have a permission issue, because the forge user can't run a mkdir inside a 755 folder of www-data.

What can I do to fix this?

One possibility is to set the default permission of created folder to 775, but I don't how to do it.

0 likes
2 replies
eduphp8's avatar
eduphp8
Best Answer
Level 26

Hi there

What I normally do is to change nginx and php-fpm users to an actual user on my system, and then run any deployment, cron jobs and processes with the same user. Also, I change the npm global bin folder to a folder like ~/.npm/bin and put it on my PATH

I dont know if this aproach is correct but it is a breeze to manage everything

snake03's avatar
Level 11

Thanks @swalker !

I'm gonna change the user of Nginx and PHP-FPM to the "main" user instead of www-data.

For those interested, you need to edit nginx.conf in nginx folder, and the fpm/pool.d/www.conf of the PHP version you're using.

Please or to participate in this conversation.