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

thebigk's avatar
Level 13

What's the main purpose of linking public/storage to storage/app/public?

I've always linked my public/storage folder to storage/app/public folder; but never questioned why. Is there any specific advantage of putting images inside storage/app/public folder and then accessing it via domain.com/storage/filename.ext ?

The only reason I could guess is that it makes it easier to deploy via GIT. But maybe there's more to it?

0 likes
4 replies
idelgado's avatar

On a production/staging setup of an application with every deployment all the contents of the public folder are lost. The contents on the storage folder are never lost with deployments. So when you link storage to the public folder you can access them from the web knowing they'll always be there between deployments.

jlrdw's avatar

No, I just put images in a folder in webroot called uploads/images. Putting them out of webroot means nothing as they are still accessible.

Various sub folders under uploads.

However for secure client images, then yes store out of webroot, in private folders. But I don't have the need for private folders. Just my opinion.

1 like
Snapey's avatar

In my book, Its about permissions. The webserver can be restricted to only being able to write to the storage folder.

1 like
thebigk's avatar
Level 13

Thank you everyone. So I guess no real advantage of linking; except for permissions.

Please or to participate in this conversation.