Filesystem Laravel 8 Laravel 9 Laravel 10 Laravel 11 Laravel 12

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

Error Message
Permission denied - Unable to write to storage

Common Causes

  1. 1 Incorrect directory permissions
  2. 2 Web server user doesn't own directories
  3. 3 SELinux or AppArmor restrictions
  4. 4 Deployment created files with wrong owner

Solutions

1

Set correct permissions on storage and cache

Bash
sudo chmod -R 775 storage bootstrap/cache
sudo chown -R $USER:www-data storage bootstrap/cache
2

For production environments

Bash
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
3

Create storage link

Bash
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

Hafiz Riaz

About Hafiz

Full Stack Developer from Italy. I build web applications with Laravel and Vue.js, and automate business processes. Creator of ReplyGenius, StudyLab, and other SaaS products.

View Portfolio

Related Errors