Repolode
plantuml-stdlib

plantuml-stdlib/C4-PlantUML

A library of C4 model macros for PlantUML that lets you draw software architecture diagrams as plain-text code.

Open-source alternative to:LucidchartVisio

Stars
7,441
Forks
1,168
Open issues
0
Last commit
9 days ago

What is it?

C4-PlantUML is a set of PlantUML macros and stereotypes that implement the C4 model for software architecture. Instead of drawing boxes by hand, you describe people, systems, containers, components and deployment nodes in a short text file, and PlantUML renders the diagram. This makes architecture diagrams easy to version-control and review alongside code.

The library provides separate includes for System Context, Container, Component, Dynamic, Deployment and a C4-styled Sequence diagram. Each includes macros for common elements, external variants, databases and queues, boundaries, and relationships with optional direction control. It also supports sprites and icons, links on elements, custom tags with auto-generated legends, and layout options.

The project is platform independent and open source, and it ships with VS Code snippets and IntelliJ live templates. Diagrams can be rendered with a local PlantUML jar or through the PlantUML web server, and the library can be included either from the repository URL or from the standard library bundled with PlantUML.

Key features

  • 01Macros for System, Container, Component, Dynamic, Deployment and C4-styled Sequence diagrams.
  • 02Element types for people, systems, containers, databases, queues and external items.
  • 03Directional relationship macros and boundary grouping.
  • 04Icon sprites, element links and custom tags with an auto-generated legend.
  • 05Editor support through VS Code snippets and IntelliJ live templates.

Use cases

  • Documenting software architecture during up-front design sessions.
  • Keeping architecture diagrams in the same repository as the code they describe.
  • Communicating system context and container structure to non-specialist stakeholders.

Quick start

  1. 1

    Include the C4_Container library in your .puml file

    !include <C4/C4_Container>
  2. 2

    Write C4 elements and relationships in plain text inside @startuml/@enduml

  3. 3

    Render the diagram with PlantUML, for example using the jar file

    java -jar plantuml.jar -DRELATIVE_INCLUDE="." ...

Things to know

  • Diagrams require PlantUML to render, so you need Java or a PlantUML server to view them.

Topics

FAQ

What is C4-PlantUML?
A library of C4 model macros for PlantUML that lets you draw software architecture diagrams as plain-text code. C4-PlantUML is a set of PlantUML macros and stereotypes that implement the C4 model for software architecture. Instead of drawing boxes by hand, you describe people, systems, containers, components and deployment nodes in a short text file, and PlantUML renders the diagram. This makes architecture diagrams easy to version-control and review alongside code.
Is C4-PlantUML free to use? What license does it have?
C4-PlantUML is open source under the MIT license. Check the license terms before using it in commercial products.
Is C4-PlantUML still maintained?
Actively maintained. The last commit to C4-PlantUML was on Oct 13, 2026.
What can I use C4-PlantUML for?
Documenting software architecture during up-front design sessions. Keeping architecture diagrams in the same repository as the code they describe. Communicating system context and container structure to non-specialist stakeholders.
How do I install C4-PlantUML?
Include the C4_Container library in your .puml file: !include <C4/C4_Container> Write C4 elements and relationships in plain text inside @startuml/@enduml Render the diagram with PlantUML, for example using the jar file: java -jar plantuml.jar -DRELATIVE_INCLUDE="." ...
Where can I get C4-PlantUML?
The source code and installation instructions are on GitHub: https://github.com/plantuml-stdlib/C4-PlantUML

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects