Console commands (CLI)

TYPO3 supports running scripts from the command line. This functionality is especially useful for automating tasks such as cache clearing, maintenance, and scheduling jobs.

System administrators and developers can use predefined commands to interact with the TYPO3 installation directly from the terminal.

To learn how to run TYPO3 CLI commands in various environments (such as Composer projects, Classic installations, DDEV, Docker, or remote servers), refer to How to run a command.

A list of available Core commands is provided here: List of Core console commands. Additional commands may be available depending on installed extensions. The extension helhum/typo3-console is frequently installed to provide a wider range of CLI commands.

If you are developing your own TYPO3 extension, you can also create custom console commands to provide functionality specific to your use case. These commands integrate with the TYPO3 CLI and can be executed like any built-in command.

For more information, see Writing Custom Commands.

Command usage in terminal environments

To execute TYPO3 console commands, you need access to a terminal (command line interface). You can run commands locally or on a remote server.

The entry point for running commands depends on the type of TYPO3 installation.

To display a list of all available commands, use the following:

vendor/bin/typo3
Copied!
typo3/sysext/core/bin/typo3
Copied!
ddev typo3
Copied!
bin/typo3
Copied!

Local development environments

If you are working on a local development environment such as DDEV, MAMP, or a native PHP installation, open a terminal and navigate to your project directory. Then, run the command using the appropriate entry point for your installation (Composer or Classic mode).

cd my-typo3-project
vendor/bin/typo3 list
Copied!

Using the CLI with DDEV

If you are using DDEV, you can run TYPO3 commands from your host machine using the ddev typo3 shortcut. This automatically routes the command into the correct container and environment.

For example, to flush all caches:

ddev typo3 cache:flush
Copied!

You can use this shortcut with any TYPO3 CLI command:

ddev typo3 <your-command>
Copied!

Using the CLI in Docker containers

If you are using Docker directly (without DDEV or a wrapper), TYPO3 commands must usually be executed inside the container that runs PHP and TYPO3.

First, open a shell inside the container. For example:

docker exec -it my_php_container bash
Copied!

Replace my_php_container with the name of your running PHP container.

Once inside the container, navigate to the project directory and run the command:

cd /var/www/html
vendor/bin/typo3 list
Copied!

You typically cannot run TYPO3 commands from the host system unless the project's PHP environment is directly accessible outside the container.

Executing commands on remote servers via SSH

For TYPO3 installations on a remote server, you typically access the server using SSH (Secure Shell).

Use the following command to connect:

ssh username@example.com
Copied!

Replace username with your SSH username and example.com with the server hostname or IP address.

Once logged in, navigate to your TYPO3 project directory and execute the command. For example:

cd /var/www/my-typo3-site
vendor/bin/typo3 list
Copied!

Making the CLI entry point executable

The TYPO3 command entry point (e.g. vendor/bin/typo3) must be marked as executable in order to run it directly.

To make the file executable, run:

chmod +x vendor/bin/typo3
Copied!

If you do not have permission to change the file mode or the file system is read-only, you can run the script by calling the PHP interpreter explicitly:

php vendor/bin/typo3 list
Copied!

This method works even if the file is not executable.

Executing commands from the scheduler

By default, it is possible to run a command from the TYPO3 Scheduler as well. To do this, select the task Execute console commands followed by your command in the Schedulable Command field.

In order to prevent commands from being set up as scheduler tasks, see 1. Register the command.

Using CLI commands in CI/CD pipelines

In continuous integration (CI) or continuous deployment (CD) pipelines, TYPO3 CLI commands can be used for tasks such as preparing the system, checking configuration, or activating extensions (Classic mode).

See also chapter CI/CD: Automatic deployment for TYPO3 Projects.

The exact command entry point depends on your installation type. For example:

vendor/bin/typo3 list
Copied!

Before you can run most TYPO3 CLI commands, ensure the following:

  • You have run composer install so that the vendor/ directory and CLI entry point exist.
  • The PHP environment is set up (with extensions such as pdo_mysql).
  • The environment variable TYPO3_CONTEXT is set appropriately, such as Production or Testing.

If you want to run commands such as cache:flush after deployment, it is common to use the CI pipeline to connect to the remote server and execute the command there using SSH:

ssh user@your-server.example.com 'cd /var/www/html && vendor/bin/typo3 cache:flush'
Copied!

This pattern is often used in post-deployment steps to finalize setup in the live environment.

Clearing the cache with cache:flush

A common use case is to use a console command to flush all caches, for example during development.

vendor/bin/typo3 cache:flush
Copied!
typo3/sysext/core/bin/typo3 cache:flush
Copied!

Viewing help for CLI commands

Show help for the command:

vendor/bin/typo3 cache:flush -h
Copied!
typo3/sysext/core/bin/typo3 cache:flush -h
Copied!