---
title: "Services.yaml"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extension-configuration-services-yaml@main"
source: "ExtensionArchitecture/FileStructure/Configuration/ServicesYaml.rst"
rendered: "2026-09-22T15:26:06+00:00"
---

# `Services.yaml` {#extension-configuration-services-yaml}

It is possible to use YAML or PHP format:

-   **Services.yaml**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/Configuration/Services.yaml
    -   *Path (Classic):* typo3conf/ext/my_extension/Configuration/Services.yaml

-   **Services.php**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/Configuration/Services.php
    -   *Path (Classic):* typo3conf/ext/my_extension/Configuration/Services.php

This file can configure services. TYPO3 uses it for:

-   [Dependency Injection](https://docs.typo3.org/permalink/t3coreapi:configure-dependency-injection-in-extensions@main)
-   [Event Listeners](https://docs.typo3.org/permalink/t3coreapi:eventdispatcherregistration@main)
-   Command Controllers (see [Feature: #89139 - Add dependency injection
    support for console commands](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.3/Feature-89139-AddDependencyInjectionSupportForConsoleCommands.html))
-   [Registering a widget with the dashboard](https://docs.typo3.org/c/typo3/cms-dashboard/main/en-us/Configuration/WidgetRegistration.html#register-new-widget)

**EXT:my_extension/Configuration/Services.yaml**

```yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  T3docs\Examples\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

  MyVendor\MyExtension\LinkValidator\LinkType\ExampleLinkType:
    tags:
      -  name: linkvalidator.linktype

```

> [!NOTE]
> **See also**
>
> -   TYPO3 uses the Symfony Dependency Injection component. The official documentation can be found at
>     [https://symfony.com/doc/current/service_container.html](https://symfony.com/doc/current/service_container.html)
> -   It is possible to use a glob pattern for the file paths, for example `'../Classes/*'`.
