Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Creating Your First Symfony Project

Creating Your First Symfony Project

~13 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

Now let's create the actual project – with the webapp template, which already pre-installs Twig, Doctrine, Security, and other bundles our task manager needs.

Creating the project

symfony new aufgaben-manager --version="7.2.*" --webapp
cd aufgaben-manager

--webapp installs the "webapp" skeleton (including Twig, Doctrine, Security, Mailer, Forms) instead of the minimal "microservice" skeleton – exactly right for a classic web application like our task manager. Alternatively, without the Symfony CLI, directly via Composer:

composer create-project symfony/skeleton:"7.2.*" aufgaben-manager
cd aufgaben-manager
composer require webapp

The project structure at a glance

Symfony project structure right after installation

aufgaben-manager/
├── bin/
│   └── console
├── config/
│   ├── packages/
│   ├── routes.yaml
│   └── services.yaml
├── migrations/
├── public/
│   └── index.php
├── src/
│   ├── Controller/
│   ├── Entity/
│   ├── Repository/
│   └── Kernel.php
├── templates/
├── tests/
├── var/
│   ├── cache/
│   └── log/
├── vendor/
├── .env
└── composer.json
  • bin/console – Symfony's command-line tool INSIDE the project (clear cache, run migrations, custom commands – from chapter 39 on).
  • config/ – ALL configuration: bundles, routes, services (chapter 4).
  • public/index.php – the ONLY publicly reachable entry point, the kernel gets rebooted for EVERY request.
  • src/ – your own application code: controllers, entity classes, services.
  • templates/ – Twig templates (chapter 13).
  • var/cache/ and var/log/ – generated files, NEVER version-control these.
  • vendor/ – dependencies managed by Composer, NEVER version-control these.

Starting the dev server

symfony server:start -d
# -d = in the background (daemon)

Open https://localhost:8000 – Symfony's "Welcome Page" confirms the installation works. The Symfony CLI automatically sets up a local, self-signed HTTPS certificate along the way.

Getting to know bin/console

A central tool that accompanies us through this ENTIRE course – run it with no arguments to see ALL available commands:

php bin/console
# or shorter, if the Symfony CLI is installed:
symfony console
php bin/console about
# shows the project environment, PHP version, installed bundles

Tipp: php bin/console list shows a complete, namespace-grouped overview of ALL available commands – a good first stop when you later look for a specific command whose exact name you've forgotten.

A very first, minimal controller

Before we systematically cover routing in chapter 7, a tiny preview that the installation REALLY works:

src/Controller/WelcomeController.php
<?php

declare(strict_types=1);

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

class WelcomeController extends AbstractController
{
    #[Route('/welcome', name: 'welcome')]
    public function index(): Response
    {
        return new Response('Task manager is running!');
    }
}

Open https://localhost:8000/welcome – if the text appears, your installation works fully. #[Route(...)] is a PHP attribute (NOT a comment!) – Symfony reads it at runtime to know which URL belongs to which method. Chapter 7 explains this in detail.