🗂️ File and Folder permission for Laravel

June 19, 2020 (4y ago)

Run these commands on your terminal to set up proper permission for your Laravel project files and folders.

🖥️

sudo find /path/to/your/laravel/root/directory -type d -exec chmod 775 ;

🖥️

sudo find /path/to/your/laravel/root/directory -type f -exec chmod 664 ;

🖥️

sudo chown -R my-user:www-data /path/to/your/laravel/root/directory

You will also need to change permission for your storage folder and cache folder inside the bootstrap folder.

🖥️

cd /path/to/your/laravel/root/directory

🖥️

sudo chgrp -R www-data storage bootstrap/cache

🖥️

sudo chmod -R ug+rwx storage bootstrap/cache