Classic TYPO3 demo installation using Docker Compose
Warning
This setup is intended for local testing and learning.
This guide shows how to run the same TYPO3 demo environment from the Classic TYPO3 demo installation using Docker only using Docker Compose.
Instead of running each container manually with docker run
, we define the
entire setup in a single docker-
file. This makes it easier
to start, stop, and manage services as a group.
Tip
New to Docker Compose? Start here: Getting started with Docker Compose.
Table of contents
How to run TYPO3 with Docker Compose
Create a project directory
mkdir compose_demo_typo3
cd compose_demo_typo3
mkdir -p fileadmin typo3conf typo3temp
# Linux/WSL only (fix permissions during development)
# chmod -R 777 fileadmin typo3conf typo3temp
# sudo chown -R 33:33 fileadmin typo3conf typo3temp
Create the docker-compose.yml file
services:
db:
image: mariadb:10.6
container_name: compose-demo-typo3db
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: db
MYSQL_PASSWORD: db
volumes:
- db_data:/var/lib/mysql
web:
image: martinhelmich/typo3:latest
container_name: compose-demo-typo3
# Using linux? Uncomment the line below and use CURRENT_UID=$(id -u):$(id -g) docker-compose up to run
# user: ${CURRENT_UID}
ports:
- "8081:80"
depends_on:
- db
volumes:
- ./fileadmin:/var/www/html/fileadmin
- ./typo3conf:/var/www/html/typo3conf
- ./typo3temp:/var/www/html/typo3temp
volumes:
db_data:
Start the environment
docker compose up -d
Open TYPO3 in your browser
Visit:
http://localhost:8081
(This URL works because port 8081 on your host maps to port 80 in the container; see About port mapping in Docker Compose)
Use these installer settings:
- Database host:
db
- Username:
db
- Password:
db
- Database name:
db
About port mapping in Docker Compose
By default, the TYPO3 container exposes port 80 internally. In the
docker-
file, this is mapped to a port on your local machine
using the ports
option:
ports:
- "8081:80"
This means:
80
is the container’s internal web server port8081
is the port on your local machine
With this mapping, you can access TYPO3 at:
http://localhost:8081
You can change the 8081
part to any available port above 1024
, if needed.
The internal port 80
should not be changed, as it is required by the webserver
in the TYPO3 image.
Tip
Learn more: Docker Compose Networking – Ports
Stop and clean up
To stop all containers:
docker compose down
To also remove volumes (e.g. the database):
docker compose down --volumes
See also
If you encounter file permission issues, see Solving file permission issues.