Filesystem Laravel 8 Laravel 9 Laravel 10 Laravel 11 Laravel 12

Storage Link Error in Laravel - How to Fix

This error occurs when creating the symbolic link between public/storage and storage/app/public fails.

The Error

Error Message
symlink(): Permission denied / The public/storage link already exists

Common Causes

  1. 1 Symbolic link already exists
  2. 2 Permission denied (especially on Windows)
  3. 3 Shared hosting doesn't support symlinks
  4. 4 Wrong file permissions on directories

Solutions

1

Remove existing link and recreate

Bash
# Remove existing symbolic link
rm public/storage

# Or on Windows
del public\storage

# Create new link
php artisan storage:link
2

On Windows, run as Administrator

Bash
# Open Command Prompt as Administrator
# Navigate to project directory
php artisan storage:link

# Or create manually
mklink /D public\storage storage\app\public
3

Manual symlink for shared hosting

PHP
// Add temporary route in routes/web.php
Route::get('/create-symlink', function () {
    $target = storage_path('app/public');
    $link = public_path('storage');
    symlink($target, $link);
    return 'Symlink created!';
});

// Visit /create-symlink then remove the route
4

Alternative: Use public disk directly

PHP
// In config/filesystems.php, add custom disk
'public_uploads' => [
    'driver' => 'local',
    'root' => public_path('uploads'),
    'url' => env('APP_URL').'/uploads',
    'visibility' => 'public',
],

// Use in code
Storage::disk('public_uploads')->put('file.jpg', $content);

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.

Hafiz Riaz

About Hafiz

Senior Full Stack Developer. I build production software with Laravel, Filament, Vue, and AI integrations, and write about the real decisions behind shipping it.

Get in touch →

Related Errors