Symfony provides a dedicated application called the Symfony Installer to ease
the creation of Symfony applications. This installer is a PHP 5.4 compatible
executable that needs to be installed on your system only once:

In Linux and macOS, a global symfony command is created. In Windows,
move the symfony file to a directory that's included in the PATH
environment variable and create a symfony.bat file to create the global
command or move it to any other directory convenient for you:

Once the Symfony Installer is installed, create your first Symfony application
with the new command:

1

$ symfony new my_project_name

This command creates a new directory called my_project_name/ that contains
an empty project based on the most recent stable Symfony version available. In
addition, the installer checks if your system meets the technical requirements
to execute Symfony applications. If not, you'll see the list of changes needed
to meet those requirements.

Note

If the installer doesn't work for you or doesn't output anything, make sure
that the PHP Phar extension is installed and enabled on your computer.

Note

If the SSL certificates are not properly installed in your system, you
may get this error:

In case your project needs to be based on a specific Symfony version, use the
optional second argument of the new command:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

# use the most recent version in any Symfony branch$ symfony new my_project_name 2.8
$ symfony new my_project_name 3.1
# use a specific Symfony version$ symfony new my_project_name 2.8.3
$ symfony new my_project_name 3.1.5
# use a beta or RC version (useful for testing new Symfony versions)$ symfony new my_project 2.7.0-BETA1
$ symfony new my_project 2.7.0-RC1
# use the most recent 'lts' version (Long Term Support version)$ symfony new my_project_name lts

Each version has its own documentation, which you can select on any documentation
page.

Note

Read the Symfony Release process
to better understand why there are several Symfony versions and which one
to use for your projects.

If you still use PHP 5.3 or can't use the Symfony installer for any reason, you
can create Symfony applications with Composer, the dependency manager used by
modern PHP applications.

If you don't have Composer installed in your computer, start by
installing Composer globally. Then, execute the
create-project command to create a new Symfony application based on its
latest stable version:

If your Internet connection is slow, you may think that Composer is not
doing anything. If that's your case, add the -vvv flag to the previous
command to display a detailed output of everything that Composer is doing.

Symfony leverages the internal PHP web server (available since PHP 5.4) to run
applications while developing them. Therefore, running a Symfony application is
a matter of browsing to the project directory and executing this command:

1
2

$cd my_project_name/
$ php app/console server:run

Then, open your browser and access the http://localhost:8000/ URL to see the
Welcome Page of Symfony:

If you see a blank page or an error page instead of the Welcome Page, there is
a directory permission misconfiguration. The solution to this problem is
explained in the Setting up or Fixing File Permissions.

When you are finished working on your Symfony application, stop the server by
pressing Ctrl+C from the terminal or command console.

Tip

PHP's internal web server is great for developing, but should not be
used on production. Instead, use Apache or Nginx.
See Configuring a Web Server.

The Symfony Installer checks if your system is ready to run Symfony applications.
However, the PHP configuration for the command console can be different from the
PHP web configuration. For that reason, Symfony provides a visual configuration
checker. Access the following URL to check your configuration and fix any issue
before moving on:

At this point, you've created a fully-functional Symfony application! Every Symfony
app depends on a number of third-party libraries stored in the vendor/ directory
and managed by Composer.

Updating those libraries frequently is a good practice to prevent bugs and
security vulnerabilities. Execute the update Composer command to update them
all at once (this can take up to several minutes to complete depending on the
complexity of your project):

This is a fully-functional application that shows the recommended way to develop
Symfony applications. The app has been conceived as a learning tool for Symfony
newcomers and its source code contains tons of comments and helpful notes.

When working collaboratively in a Symfony application, it's uncommon to create
a new Symfony application as explained in the previous sections. Instead,
someone else has already created and submitted it to a shared repository.

It's recommended to not submit some files (parameters.yml)
and directories (vendor/, cache, logs) to the repository, so you'll have to do
the following when installing an existing Symfony application:

1
2
3
4
5
6
7
8
9
10

# clone the project to download its contents$cd projects/
$ git clone ...
# make Composer install the project's dependencies into vendor/$cd my_project_name/
$ composer install
# now Composer will ask you for the values of any undefined parameter$ ...