Laravel Storage Permission Denied - Fix Permissions
This error occurs when Laravel cannot write to the storage or bootstrap/cache directories due to insufficient file permissions.
The Error
Permission denied - Unable to write to storage
Common Causes
- 1 Incorrect directory permissions
- 2 Web server user doesn't own directories
- 3 SELinux or AppArmor restrictions
- 4 Deployment created files with wrong owner
Solutions
Set correct permissions on storage and cache
sudo chmod -R 775 storage bootstrap/cache
sudo chown -R $USER:www-data storage bootstrap/cache
For production environments
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
Create storage link
php artisan storage:link
Need Help With Your Laravel Project?
I specialize in building custom Laravel applications, process automation, and SaaS development. Whether you need to eliminate repetitive tasks or build something from scratch, let's discuss your project.
Currently available for 2-3 new projects
About Hafiz
Senior Full-Stack Developer with 9+ years building web apps and SaaS platforms. I build web applications with Laravel and Vue.js, and automate business processes. Creator of ReplyGenius, StudyLab, and other SaaS products.
View Portfolio