Install Symfony

The symfony CLI

The Symfony CLI is a small helper program that creates projects, runs a local web server, and checks that your machine meets the requirements. Install it once from the official download page, then use it for every project in this course.

Show the CLI version

symfony --version

Symfony CLI version 5.10.0

Any recent 5.x version works for this course. If the terminal answers command not found, the install step above did not finish.

symfony new blog --webapp

One command scaffolds a full project with Twig, Doctrine, forms, and validation preinstalled. The last word is the folder name, so this project will live in a folder named blog:

Create a new project named blog

symfony new blog --webapp

[OK] Your project is ready in the blog folder

The webapp option pulls in the most common packages at once. Later lessons introduce each of them one by one.

Start the server

Move into the new project folder first. The server must start inside the project so it finds the configuration and the public folder:

Start the local server inside the blog folder

symfony server:start

[OK] Web server listening on http://127.0.0.1:8000

Leave that terminal open while you work. Press Ctrl+C when you want to stop the server.

Open the welcome page

Open http://localhost:8000 in a browser. The Symfony welcome page means the install worked and the server sees your project.

If the browser cannot connect, check that the server terminal is still running and that you opened the project folder before starting it.

Next: Your first page

Article author: Arthur Isaev