Skip to main content
wpcrux.com

Back to all posts

How to Deploy Symfony on SiteGround?

Published on
7 min read
How to Deploy Symfony on SiteGround? image

Best Symfony Deployment Tools to Buy in September 2025

+
ONE MORE?

To deploy Symfony on SiteGround, you will need to follow these steps:

  1. Log in to your SiteGround account and navigate to the cPanel dashboard.
  2. Create a new database by clicking on the "MySQL Databases" option in the "Databases" section. Choose a name for your database and click on the "Create Database" button. Make sure to note down the database name, username, and password for future reference.
  3. In the "Files" section of cPanel, click on the "File Manager" option. Select the root directory of your website and click on the "Go" button. This will open the file manager.
  4. Upload your Symfony project files to the root directory using the upload feature in the file manager. You can either upload a zip file and extract it or directly upload the individual files.
  5. Once the files are uploaded, you need to set up the correct permissions for certain directories. Right click on the "var" directory within your Symfony project, and select the "Change Permissions" option. Set the numeric value to 777 and click on the "Change Permissions" button. Repeat the same process for the "var/cache" and "var/log" directories.
  6. Now, go back to the cPanel dashboard and click on the "PHP Manager" option in the "Software" section. Select the domain where you uploaded your Symfony project and make sure the PHP version is set to 7.4 (Symfony 5.x requires PHP 7.2.5 or higher).
  7. Return to the file manager and locate the "public" directory within your Symfony project. Right click on the "index.php" file and select "Edit". Look for the line that sets the environment variable and ensure it is set to "prod".
  8. Next, open a new tab or window in your web browser and enter your domain name. Symfony's installation page should appear. Follow the steps on the page to complete the installation, including entering your database details (database name, username, and password).
  9. After the installation is complete, you should see the Symfony welcome page indicating a successful deployment.

Remember to keep your Symfony project up to date with the latest releases and security patches for optimal performance and security.

What is Composer and its role in Symfony projects on SiteGround?

Composer is a dependency management tool for managing packages and libraries in PHP projects. It allows you to declare the dependencies your project needs and it installs and updates them for you.

In Symfony projects on SiteGround, Composer is used to manage the dependencies of your Symfony application. It helps in installing all the required libraries, bundles, and packages specified in your project's composer.json file.

By using Composer, you can easily add and update Symfony bundles, libraries, and other dependencies in your project. It also allows you to manage the autoloading of classes, making it easier to access and use the installed packages and libraries in your Symfony project.

SiteGround provides Composer as a built-in tool in their hosting environment, allowing you to easily manage the dependencies of your Symfony projects with Composer commands.

What is the process for setting up automated deployments for Symfony on SiteGround?

To set up automated deployments for Symfony on SiteGround, you can follow these steps:

  1. Connect to your SiteGround hosting account using your preferred FTP client or the File Manager tool provided by SiteGround.
  2. Locate the root directory of your Symfony project on the server.
  3. Create a new file in the project's root directory and name it "deploy.php".
  4. Open the "deploy.php" file and add the following code: