Running industrial SCADA systems on developer machines can sometimes lead to a cluttered host operating system, dependency conflicts, or difficulties in managing multiple software versions. WinCC Open Architecture (WinCC OA) is a powerful platform, and running it inside a Docker container for development is an elegant solution to these challenges.
In this post, we’ll walk through how to build a WinCC OA container image on your favorite Linux OS (like Ubuntu) and use a convenient access script to keep your projects organized and run GUI tools like the Console and Project Manager seamlessly.
Step 1: Building the WinCC OA Docker Image
Before running the container, we need to build the Docker image. Navigate to the directory where you downloaded and extracted the WinCC OA installation files (which should also contain your Dockerfile), and run the following command:
docker build --build-arg USER_ID=$(id -u) --build-arg USER_GID=$(id -g) --build-arg USER=$(whoami) --build-arg BASE_IMAGE=debian:bookworm -t winccoa322 .
Why these build arguments? By matching the container’s user ID and group ID with your host user, we avoid file permission issues when editing files and mapping project volumes.
Step 2: Managing the Container with run-container.sh
To automate starting, stopping, and entering the container, we use a custom shell script called run-container.sh. This script works on standard Linux installations as well as macOS using Colima (as a lightweight Docker runtime) and XQuartz (for X11 GUI forwarding).
This script takes care of several important development tasks:
-
- Persistent Container Lifecycle: It checks if the container already exists. If it is stopped, it starts it. If it doesn’t exist, it creates a new one using the
winccoa322image. Since the container runs withsleep infinity, it remains active in the background.
- Persistent Container Lifecycle: It checks if the container already exists. If it is stopped, it starts it. If it doesn’t exist, it creates a new one using the
-
- Volume Mapping: Your host user home directory is mounted to the container (
-v "$HOME:/home/$USER:rw"). This ensures your projects, configurations, and license files persist on the host system and can be edited with your favorite host IDEs (like VS Code).
- Volume Mapping: Your host user home directory is mounted to the container (
-
- Reusable Sessions: You can run the script to enter the running container terminal via
docker exec -it winccoa bash, perform your tasks, and exit without stopping the container or losing state.
- Reusable Sessions: You can run the script to enter the running container terminal via
Note on configuration using a .env file: The script checks if a .env file exists in its directory and loads its environment variables (using set -a and source). This allows you to easily customize variables such as CONTAINER_NAME, WCC_OA_IMAGE, or WCC_OA_VERSION without having to modify the shell script itself.
You can download the full script here:
Step 3: Running Graphical Tools (Console & Project Manager)
WinCC OA relies on graphical interfaces for project management and engineering. The script passes your host’s DISPLAY environment variable and network configuration to the container so that X11 applications can render on your host screen.
However, X11 security will block the container from connecting by default. To authorize the container, you must run the following command in a terminal session on your host machine before starting GUI tools:
xhost +
Once authorized, you can run commands like startPA inside the container, and the Project Manager window will appear on your desktop as if it were running natively.
Summary
Running WinCC OA in a container gives you a clean, isolated environment for SCADA development. Volume mapping keeps your code safe on the host machine, and X11 forwarding gives you access to the full suite of graphical development tools without the overhead of a virtual machine.




















