How do I deploy a Laravel or Symfony site?
On your hosting, you need to place your files in the public_html directory, but this causes a problem with frameworks like Symfony or Laravel, which require their files to be placed in a public directory.
There's a simple method for using Symfony or Laravel with your hosting:
- Log in via SSH or go to the Terminal in cPanel
- Check that you're in the root of your hosting:
cd ~
- Rename the
public_htmldirectory with the following command:
mv public_html public_html_bak
- Create a symlink between your
publicdirectory andpublic_htmlwith the following command (adjust/home/monuser/monappli/publicto match your setup):
ln -s /home/monuser/monappli/public public_html
- Finally, to run
composer, you need to specify the PHP version to use if you've changed your hosting's PHP version, for example to use PHP 8.2 withcomposer:
ea-php82 /usr/local/bin/composer install
You can also create an alias in your shell if you'd like to call composer with just the composer command.
Tip: if you're on a plan where SSH access isn't included, our technical support will do this for you. Just let us know the path to your public directory.
Updated on: 17/07/2026
Thank you!