# Laravel File Permission on Apache 1. Set the owner & group of file & folder to apache user (**www-data**) ```bash sudo chown -R www-data:www-data /path/to/your/root/directory sudo chown -R www-data:www-data /path/to/your/root/directory ``` 2. Add user to the webserver user group ```bash sudo usermod -a -G www-data ubuntu ``` 3. Set file & directory permission to **775** & **644** ```bash sudo find /path/to/your/root/directory -type f -exec chmod 644 {} \; sudo find /path/to/your/root/directory -type d -exec chmod 775 {} \; ``` 4. Vive read and write permissions to the webserver for storage, cache and any other directories the webserver needs to upload or write too ```bash sudo chgrp -R www-data storage bootstrap/cache sudo chmod -R ug+rwx storage bootstrap/cache ``` Source : [https://laracasts.com/discuss/channels/general-discussion/laravel-framework-file-permission-security](https://laracasts.com/discuss/channels/general-discussion/laravel-framework-file-permission-security)