Structurizr

The original tool for the C4 model

Models as code | open source | manual layout | AI friendly

GitHub repo | Docs | Patreon

Structurizr is a "models as code" tool designed for the C4 model - you write Structurizr DSL to create multiple software architecture diagrams from a single model. Structurizr was created by the author of the C4 model and remains the reference implementation, making it the best choice if you are looking for compliance and compatibility with the C4 model.

workspace {

    !identifiers hierarchical

    model {
        u = person "User"
        ss = softwareSystem "Software System" {
            wa = container "Web Application"
            db = container "Database Schema" {
                tags "Database"
            }
        }

        u -> ss.wa "Uses"
        ss.wa -> ss.db "Reads from and writes to"
    }

    views {
        systemContext ss "Diagram1" {
            include *
        }

        container ss "Diagram2" {
            include *
        }

        styles {
            ...
        }
    }

}
Multiple diagrams from a single model
Multiple diagrams from a single model
Multiple diagrams from a single model

This Structurizr DSL example creates two diagrams based upon a single set of elements and relationships.

Structurizr DSL tutorial | Try it in the playground

Designed for the C4 model

Structurizr is specifically designed to support the C4 model for visualising software architecture, by its creator Simon Brown. Diagrams are interactive (e.g. zoom in/out), animatable, embeddable, and include an automatically generated diagram key/legend - see the interactive example for a demo.


System Landscape diagram

System Landscape diagram

System Landscape diagram key

System Context diagram

System Context diagram

System Context diagram key

Container diagram

Container diagram

Container diagram key

Component diagram

Component diagram

Component diagram key

Dynamic diagram

Dynamic diagram

Dynamic diagram key

Deployment diagram

Deployment diagram

Deployment diagram key

Tooling options

playground

A browser-based playground that can be used to create diagrams and experiment with the DSL.

local

Provides a way to view diagrams and modify their layout on your local computer (the equivalent of the previous Structurizr Lite).

server

A self-hosted Structurizr server (the equivalent of the previous Structurizr on-premises installation). Two versions are available - open core (build yourself) and pre-built binaries with features designed for use in enterprise environments (license required).

export

A CLI tool to export the views in a Structurizr workspace to PlantUML, Mermaid, or a static HTML site.

Single binary

Docker image

docker pull structurizr/structurizr
docker run -it --rm -v $PWD:/usr/local/structurizr structurizr/structurizr <command> [parameters]

Java .war file

curl -O https://download.structurizr.com/structurizr.war
java -jar structurizr.war <command> [parameters]


MCP server

A standalone, free and open source, MCP server is also available to parse & validate DSL, export diagrams to PlantUML & Mermaid, and manage workspaces hosted on a Structurizr server.