Articles on: 🌍 Web Hosting & PaaS
This article is also available in:

How do I deploy a Laravel or Symfony site?

Two methods, depending on whether you want to deploy from a Git repository or install the application by hand on your hosting.



Hodifly deploys your Laravel or Symfony application straight from GitHub or GitLab on every git push. There is no SSH, no symlink and no composer install to run: it all happens on the server, on every deploy.


Hodifly works on every web hosting plan, including the cheapest ones: a PHP application is served by the web server itself, so it does not need the "applications" feature that Node, Python and Ruby apps require.


What Hodifly does for you


  • The document root points automatically at the front-controller folder of the deployed release: public/ for Laravel and Symfony. The rest of the application (.env, vendor/, app/, config/, storage/) is never reachable over HTTP. That is exactly the problem the manual method below solves with a symlink: here there is nothing to do.
  • Composer runs on every deploy (install --no-dev --prefer-dist --optimize-autoloader). Commit your composer.lock.
  • The .env file is generated from the project's environment variables. Do not commit a .env. APP_KEY (Laravel) and APP_SECRET (Symfony) are generated once and kept outside the releases, so sessions survive deploys.
  • Migrations run before the new release goes live. A failed migration leaves the previous release serving: the site does not break.
  • Front-end assets (Vite, Laravel Mix, Webpack Encore) are built automatically when your package.json has a build script.
  • Laravel's scheduled tasks are wired into the account's crontab on their own.
  • Rolling back is instant from cPanel, with no rebuild.


Getting started


  1. Open cPanel > Hodifly and connect your GitHub or GitLab repository.
  2. Pick the branch and the domain (or subfolder) to deploy.
  3. Leave the build command empty: Composer and assets are handled automatically.
  4. Fill in your environment variables (database, API keys), then deploy.


The full details (runtimes, monorepos, queues, persistent data) are in What can I deploy on Hodifly?.


💡 Good to know: Hodifly also recognises Lumen, CodeIgniter 4, Yii 2, CakePHP and Slim, and points the document root at the right folder for each one (public/, web/ or webroot/).


Manual: install the application yourself


If you are not using Hodifly and you install the application by hand, the folder problem remains: your hosting serves public_html, while Laravel and Symfony require their public folder to be served.


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_html directory with the following command:

mv public_html public_html_bak

  • Create a symlink between your public directory and public_html with the following command (adjust /home/monuser/monappli/public to match your setup):

ln -s /home/monuser/monappli/public public_html

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: 15/08/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!