Installation & Setup

Symfony gives you two common ways to start a new project: the dedicated Symfony CLI installer, or a plain Composer command. Either one downloads a working skeleton application that you then build on top of. This page walks through both, shows how to run the local development server, and introduces Symfony Flex — the Composer plugin that makes installing Symfony packages feel almost automatic.

Installing via the Symfony CLI

The Symfony CLI is a standalone binary (not a Composer package) that manages local development tasks — creating projects, running the dev server, checking requirements, and more. Once it is installed on your machine, creating a full-stack web application is a single command:

symfony new my_project --webapp

The --webapp flag installs the webapp edition: a fuller set of bundles suited to a traditional web application — Twig for templates, the Doctrine ORM, form handling, security, and a handful of developer-experience tools already wired in.

Installing via Composer

If you don't want the extra Symfony CLI tool, or you're building something closer to a small API or microservice, Composer alone can create a project from the minimal skeleton edition:

composer create-project symfony/skeleton my_project
Webapp vs. Skeleton — what's the difference?
EditionWhat you getBest for
--webappTwig, Doctrine, forms, security, profiler, and more preinstalledFull websites and admin-style applications
symfony/skeletonOnly the bare minimum to boot a Symfony kernel and routerSmall APIs and microservices where you add packages as you need them
Note: Both commands are correct, real Symfony commands to run in your own terminal. This website's own project doesn't have Symfony installed, so nothing here executes live on this page — copy the commands into your own project to follow along.

Starting the Development Server

Once inside your project folder, the Symfony CLI's built-in web server is the quickest way to preview your application, complete with a locally trusted TLS certificate:

cd my_project
symfony server:start

By default this serves your application at https://127.0.0.1:8000. The first time you run it, the CLI may offer to install a local certificate authority so the https URL doesn't show a browser warning.

What Is Symfony Flex?

Symfony Flex is a Composer plugin that ships with every new Symfony project. When you run composer require for a supported package, Flex looks up a matching recipe and automatically drops in the configuration files, bundle registration, and boilerplate that package needs — instead of you wiring it up by hand.

composer require twig

Behind that one command, Flex may register the TwigBundle, create a config/packages/twig.yaml, and add a templates/ folder — all automatically. You don't need to master Flex to use Symfony; just know that it's the reason installing packages feels lighter than plain Composer usage elsewhere.

Key Top-Level Folders

FolderWhat lives here
config/Application configuration and route definitions
src/Your application's PHP code — controllers, entities, services
templates/Twig view files rendered by your controllers
public/The web server's document root — the only folder exposed to the browser
var/Generated cache and log files, safe to clear
Up next: Head to Directory Structure for a deeper look at how src/ and config/ are organized, and why.