Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MuhammadShuja's avatar

L5.5 Create symlink between storage and public directories on shared hosting using SSH

I've setup my production server on a shared hosting my directory structure looks like this (my project is placed at same level as public):

    /home/user/my-laravel-project/
    /home/user/public_html

This is how I'm storing my data in Storage > Public Disc

    $data->store('path/to/data', 'public');

On production, using SSH, when I run this command php artisan storage:link. It creates a symlink between storage/app/public and my-laravel-project/public I want this link to be created between storage/app/public and /home/user/public_html

What I've tried

Tried removing my-laravel-project/public then tried php artisan storage:link .. it failed with an error No file or directory I tried changing storage path from storage_path('app/public) to public_path() under config/filesystem.php but no success I've also tried to create symlink using shell command ln -nsf /home/user/public_html storage/app/public but no success Tried many other little tweaks but nothing works for me .. I'm looking for a proper solution to create a symlink between storage/app/public and /home/user/public_html on my shared server

Note I don't want to change paths in config/filesystems.php as that's not a proper solution

My current server is setup on Siteground with php version 7.0.32 and Laravel 5.5.43

0 likes
0 replies

Please or to participate in this conversation.