---
title: "Classic TYPO3 demo installation using Docker only"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:classic-docker-installation@main"
source: "Administration/Docker/DockerDemo/Index.rst"
rendered: "2026-09-24T12:36:55+00:00"
---

# Classic TYPO3 demo installation using Docker only {#classic-docker-installation}

> [!WARNING]
> This setup is intended for **local testing and learning**.

This guide shows how to set up a TYPO3 demo site using **basic Docker commands** —
without [Docker Compose](https://docs.typo3.org/permalink/t3coreapi:docker-compose-typo3@main)
or [DDEV](https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/Installation/Install.html#install).

By building the environment step by step, you’ll learn how Docker actually works,
how containers run, how they talk to each other, how volumes persist data, and how
services like TYPO3 and MariaDB connect via networking. This hands-on setup is ideal
for those who want to understand the fundamentals of containerized TYPO3 — not just
use a prebuilt stack.

This is a local development setup, **not a production deployment**.

This setup runs TYPO3 in
[Classic mode](https://docs.typo3.org/permalink/t3coreapi:legacyinstallation@main)
using the image
[martinhelmich/typo3](https://hub.docker.com/r/martinhelmich/typo3)
along with a MariaDB container.

> [!TIP]
> New to Docker? Start here:
> [Docker Get Started Guide](https://docs.docker.com/get-started/).

-   [Quick start](https://docs.typo3.org/permalink/t3coreapi:quick-start@main)
-   [Prerequisites for using TYPO3 in Docker locally](https://docs.typo3.org/permalink/t3coreapi:prerequisites-for-using-typo3-in-docker-locally@main)
-   [Step-by-step Docker setup](https://docs.typo3.org/permalink/t3coreapi:step-by-step-docker-setup@main)
-   [Understanding port mapping](https://docs.typo3.org/permalink/t3coreapi:understanding-port-mapping@main)
-   [Resetting the environment](https://docs.typo3.org/permalink/t3coreapi:resetting-the-environment@main)
-   [Helpful Docker commands](https://docs.typo3.org/permalink/t3coreapi:helpful-docker-commands@main)
-   [Solving file permission issues](https://docs.typo3.org/permalink/t3coreapi:solving-file-permission-issues@main)
-   [Selecting TYPO3 versions in the Docker container](https://docs.typo3.org/permalink/t3coreapi:selecting-typo3-versions-in-the-docker-container@main)
-   [Considerations for production](https://docs.typo3.org/permalink/t3coreapi:considerations-for-production@main)

## Quick start {#classic-docker-quickstart}

To quickly launch TYPO3 in classic mode with Docker:

**/projects/typo3demo/$**

```bash
mkdir -p fileadmin typo3conf typo3temp

# On Linux and WSL during development: Ensure TYPO3 can write to these directories
# chmod -R 777 fileadmin typo3conf typo3temp

docker network create typo3-demo-net
```

**/projects/typo3demo/$**

```bash
docker run -d --name typo3db --network typo3-demo-net \
  -e MYSQL_ROOT_PASSWORD=secret \
  -e MYSQL_DATABASE=db \
  -e MYSQL_USER=db \
  -e MYSQL_PASSWORD=db \
  mariadb:latest

```

**/projects/typo3demo/$**

```bash
docker run -d -p 8080:80 --name typo3-demo --network typo3-demo-net \
  -v "$(pwd)/fileadmin:/var/www/html/fileadmin" \
  -v "$(pwd)/typo3conf:/var/www/html/typo3conf" \
  -v "$(pwd)/typo3temp:/var/www/html/typo3temp" \
  -e TYPO3_CONTEXT=Development/Docker \
  -e PHP_DISPLAY_ERRORS=1 \
  martinhelmich/typo3

```

If you are working on Linux or WSL, see
[Solving file permission issues](https://docs.typo3.org/permalink/t3coreapi:classic-docker-permissions@main).

Then open:

```text
http://localhost:8080
```

Use these database settings in the TYPO3 installer:

-   **Database Host**: `typo3db`
-   **Username**: `db`
-   **Password**: `db`
-   **Database Name**: `db`

## Prerequisites for using TYPO3 in Docker locally {#classic-docker-prerequisites}

-   Docker installed. See
    [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/).
-   Basic knowledge of Docker.
-   A web browser to access TYPO3.

## Step-by-step Docker setup {#classic-docker-setup}

### 1\. Prepare a project directory {#classic-docker-project}

Create a local project directory and subfolders for TYPO3's writable directories:

**/projects/$**

```bash
mkdir -p typo3demo
cd typo3demo
mkdir -p fileadmin typo3conf typo3temp
# On Linux and WSL during development: Ensure TYPO3 can write to these directories
# chmod -R 777 fileadmin typo3conf typo3temp

```

### 2\. Create a user-defined Docker network {#classic-docker-network}

**/projects/typo3demo/$**

```bash
docker network create typo3-demo-net
```

### 3\. Start the MariaDB database container {#classic-docker-db}

**/projects/typo3demo/$**

```bash
docker run -d --name typo3db --network typo3-demo-net \
  -e MYSQL_ROOT_PASSWORD=secret \
  -e MYSQL_DATABASE=db \
  -e MYSQL_USER=db \
  -e MYSQL_PASSWORD=db \
  mariadb:latest

```

### 4\. Start the TYPO3 container with mounted writable directories {#classic-docker-typo3}

**/projects/typo3demo/$**

```bash
docker run -d -p 8080:80 --name typo3-demo --network typo3-demo-net \
  -v "$(pwd)/fileadmin:/var/www/html/fileadmin" \
  -v "$(pwd)/typo3conf:/var/www/html/typo3conf" \
  -v "$(pwd)/typo3temp:/var/www/html/typo3temp" \
  -e TYPO3_CONTEXT=Development/Docker \
  -e PHP_DISPLAY_ERRORS=1 \
  martinhelmich/typo3

```

If you are working on Linux or WSL, see
[Solving file permission issues](https://docs.typo3.org/permalink/t3coreapi:classic-docker-permissions@main).

### 5\. Access TYPO3 in your browser {#classic-docker-access}

Open:

```text
http://localhost:8080
```

(assuming port 8080 was mapped to internal port 80 during `docker run`; see
[Understanding port mapping](https://docs.typo3.org/permalink/t3coreapi:classic-docker-ports@main))

Use these database settings:

-   **Database Host**: `typo3db`
-   **Username**: `db`
-   **Password**: `db`
-   **Database Name**: `db`

### 6\. Project directory structure after setup {#classic-docker-structure}

-   `fileadmin/`
-   `typo3conf/`
-   `typo3temp/`

> [!NOTE]
> All writable TYPO3 content is now persisted on your local machine.
> TYPO3 Core files are reset when the container stops. You can inspect them
> by [accessing the TYPO3 container shell](https://docs.typo3.org/permalink/t3coreapi:classic-docker-shell@main).

### 7\. Stopping and starting the containers {#classic-docker-stop}

To stop the webserver container for TYPO3, run:

```bash
docker stop typo3-demo
```

To stop the database container (contained data will be kept), run:

**/projects/typo3demo/$**

```bash
docker stop typo3db
```

To start the webserver container for TYPO3, run:

```bash
docker start typo3-demo
```

To start the database container, run:

```bash
docker start typo3db
```

## Understanding port mapping {#classic-docker-ports}

The TYPO3 Docker image exposes an internal web server on **port 80**. In order
to access this service from your host machine (via a web browser), Docker
needs to map that internal container port to a port on your host system.

This is done using the `-p` flag in `docker run`:

```bash
docker run -p 8080:80 ...
```

In this example:

-   `8080` is the **host port** (your computer)
-   `80` is the **container port** (inside the TYPO3 image)

This means you can access TYPO3 at `http://localhost:8080`.

You can choose a different host port if needed, as long as it doesn't conflict
with other services. The container will always serve on port `80` internally.

> [!TIP]
> Learn more: [Docker Networking – Published Ports](https://docs.docker.com/config/containers/container-networking/#published-ports)

## Resetting the environment {#classic-docker-reset}

To **reset your TYPO3 demo environment completely**, run the following script.

> [!WARNING]
> **Caution**
>
> **This will delete all data and containers**.
> Make sure you no longer need any files or database contents before proceeding.

**/Projects/typo3site/$**

```bash
# Stop and remove containers
docker stop typo3-demo typo3db
docker rm typo3-demo typo3db

# Remove the Docker network
docker network rm typo3-demo-net

# Remove project folders
rm -rf fileadmin typo3conf typo3temp uploads

# Optionally remove Docker images (uncomment if desired)
# docker rmi martinhelmich/typo3
# docker rmi mariadb
```

After this cleanup, you can **repeat the setup instructions** to start fresh
with a clean environment.

## Helpful Docker commands {#classic-docker-command}

### Accessing the TYPO3 container shell {#classic-docker-shell}

While the container is running in detached mode, you can open an
interactive shell in the container to inspect files, check logs,
or run TYPO3 console commands.

**/projects/typo3demo/$**

```bash
docker exec -it typo3-demo /bin/bash
```

This opens an **interactive bash shell** inside the running TYPO3 container.

Type `exit` to leave the container shell.

### Running TYPO3 console commands {#classic-docker-console}

TYPO3 provides a **command-line interface (CLI)** via the `typo3/sysext/core/bin/typo3` script.

To run console commands in the running container, use:

**/projects/typo3demo/$**

```bash
docker exec -it typo3-demo /var/www/html/typo3/sysext/core/bin/typo3
```

For example, to list available commands:

**/projects/typo3demo/$**

```bash
docker exec -it typo3-demo /var/www/html/typo3/sysext/core/bin/typo3 list
```

Flush all caches:

**/projects/typo3demo/$**

```bash
docker exec -it typo3-demo /var/www/html/typo3/sysext/core/bin/typo3 cache:flush
```

## Solving file permission issues {#classic-docker-permissions}

Depending on your host operating system, TYPO3 may not be able to write
to mounted folders like `fileadmin/`, `typo3conf/`, or `typo3temp/`.

Symptoms include:

-   TYPO3 installer shows errors saving config
-   HTTP 500 errors
-   Cache or extension data not persisting

### On Linux or WSL: file ownership and permission tips {#classic-docker-permission-linux}

Linux containers often run with a web server user like `www-data` (UID 33).
Your local files may need matching ownership or permissions:

**typo3_root$ (Linux/WSL)**

```bash
# Quick fix for local development (not recommended for production)
# chmod -R 777 fileadmin typo3conf typo3temp

# Safer alternative: match the container's web server user (usually UID 33 for www-data)
sudo chown -R 33:33 fileadmin typo3conf typo3temp
```

### macOS and Windows Docker file permission issues {#classic-docker-permissions-mac}

If you are using Docker Desktop, you usually **do not need to change permissions**.
Docker handles this automatically in most cases.

If you still run into issues, try restarting Docker and ensure file sharing is enabled
for the folder you're working in.

## Selecting TYPO3 versions in the Docker container {#classic-docker-versions}

By default, the `martinhelmich/typo3` image runs the latest available TYPO3
LTS release (at the time of writing `14.3.*`) when using the `latest` tag.

To run a specific TYPO3 version, use the corresponding image tag in your
`docker run` command. For example:

**Run TYPO3 version 12.4**

```bash
docker run -d -p 8080:80 --name typo3-demo \
    --network typo3-demo-net \
    -v "$(pwd)/fileadmin:/var/www/html/fileadmin" \
    -v "$(pwd)/typo3conf:/var/www/html/typo3conf" \
    -v "$(pwd)/typo3temp:/var/www/html/typo3temp" \
    -v "$(pwd)/uploads:/var/www/html/uploads" \
    martinhelmich/typo3:12.4
```

Check [https://hub.docker.com/r/martinhelmich/typo3/tags](https://hub.docker.com/r/martinhelmich/typo3/tags) for the full list
of available versions.

## Considerations for production {#classic-docker-production}

This guide demonstrates a **quick and temporary setup** for local development
and testing purposes only.

It **should not be used in production environments** as is.

-   [Docker production best practices](https://docs.docker.com/develop/dev-best-practices/)
-   [Deploying TYPO3](https://docs.typo3.org/permalink/t3coreapi:deployment@main)
-   [Security guidelines for system administrators](https://docs.typo3.org/permalink/t3coreapi:security-administrators@main)
