---
title: "Quick start"
manual: "Firewall"
version: "0.10"
permalink: "https://docs.typo3.org/permalink/flowd/typo3-firewall:quick-start@0.10"
source: "QuickStart.rst"
rendered: "2026-11-12T21:00:51+00:00"
---

# Quick start {#quick-start}

Follow these steps to get a working firewall in a Composer-based TYPO3
project.

## 1\. Install the extension {#1-install-the-extension}

```bash
composer require flowd/typo3-firewall
```

The frontend middleware is registered automatically. Without a configuration
file the firewall only enforces the block patterns managed in the backend
module.

## 2\. Create the configuration file {#2-create-the-configuration-file}

Create the file `config/system/phirewall.php`. This minimal example blocks
requests for paths that only scanners ask for:

```php
<?php
use Flowd\Phirewall\Config;
use Flowd\Phirewall\Store\PdoCache;
use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;

return function (EventDispatcherInterface $eventDispatcher): Config {
    $cache = new PdoCache(GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('phirewall_cache')->getNativeConnection());
    $config = new Config($cache, $eventDispatcher);

    $config->blocklists->add(
        name: 'block-env-probes',
        callback: fn($request) => str_starts_with(strtolower($request->getUri()->getPath()), '/.env')
    );

    return $config;
};
```

The `PdoCache` store creates its `phirewall_cache` table on its own the
first time it runs. You must also declare the table in the
`ext_tables.sql` of your site package, otherwise TYPO3 treats it as
unused; [Storage](https://docs.typo3.org/permalink/flowd/typo3-firewall:storage@0.10) shows the definition and other store options.

> [!IMPORTANT]
> `PdoCache` needs a database connection with a PDO driver such as
> `pdo_mysql`. With the `mysqli` driver it does not work. Check the
> `driver` entry in `config/system/settings.php`; [Storage](https://docs.typo3.org/permalink/flowd/typo3-firewall:storage@0.10)
> explains the options.

The extension resolves the client IP for you through TYPO3, so the firewall
sees the real visitor address behind a reverse proxy or CDN
(see [Trusted proxies](https://docs.typo3.org/permalink/flowd/typo3-firewall:trusted-proxies@0.10)).

## 3\. Verify it works {#3-verify-it-works}

Request a blocked path. The firewall answers with status 403:

```bash
curl -i https://www.example.org/.env
```

Regular pages keep working as before.

## Next steps {#next-steps}

-   Add rate limiting, bans, and presets: [Configuration](https://docs.typo3.org/permalink/flowd/typo3-firewall:configuration@0.10) and [Presets](https://docs.typo3.org/permalink/flowd/typo3-firewall:presets@0.10)
-   Pick the right store for your hosting: [Storage](https://docs.typo3.org/permalink/flowd/typo3-firewall:storage@0.10)
-   Manage block patterns and see statistics in the backend: [Backend module](https://docs.typo3.org/permalink/flowd/typo3-firewall:backend-module@0.10) and [Statistics](https://docs.typo3.org/permalink/flowd/typo3-firewall:statistics@0.10)
