Link Laravel Storage in Plesk Panel

Published on May 2, 2024. Last updated on January 22, 2025.
Link Laravel Storage in Plesk Panel

If you've faced challenges deploying a Laravel app on a Plesk Panel Managed Hosting Provider, you know how tricky linking the storage directory can be. In this post, we'll explore how to resolve this issue.

First, navigate to Domains -> yourdomain -> Hosting & DNS -> Apache & nginx, and ensure that the "Restrict the ability to follow symbolic links" option is unchecked.

After updating the settings, search for "SSH Terminal" in the search box and execute the following commands:

First, change directory to your domain's root (the directory might be named differently depending on your Plesk and Laravel installation):

cd /var/www/vhosts/yourdomain.com/httpdocs

Now, run the storage:link command with the relative option (Change the PHP Version to your installed version):

/opt/plesk/php/8.2/bin/php ./artisan storage:link --relative

To override an existing symbolic link, add the force flag (--force) to the command:

/opt/plesk/php/8.2/bin/php ./artisan storage:link --relative --force

In conclusion, linking Laravel's storage in Plesk Shared Hosting can be a bit challenging, but by following these steps, you can ensure that your files are properly managed and accessible. Remember to adjust the PHP version and directory paths as needed for your specific setup. If you encounter any issues, don't hesitate to reach out to your hosting provider or the Laravel community for assistance.