Quick Start Guide to PlantUML

For those interested in an initial exploration of PlantUML, we recommend using an online platform that directly supports PlantUML.

Explore it on our online server.

Local Installation Procedure

After trying the online version, if you're considering a more comprehensive local environment, a local installation of PlantUML is suggested. Before installation, ensure the following prerequisites are met:

Java: PlantUML requires Java to be installed on your machine.

GraphViz: Needed only for some diagrams.

Once ready, download the plantuml.jar file and execute it to access PlantUML’s graphical user interface. No further unpacking or installation procedures are needed.

Command Line Operations

For those familiar with command line interfaces or intending to integrate PlantUML with scripting or documentation platforms, PlantUML offers a convenient command line syntax. Follow these steps:

1.Compose a Text File: Document your PlantUML commands. Here's a sample sequenceDiagram.txt:

@startuml
Alice -> Bob: test
@enduml

2.Execute the File: Process the aforementioned text file:

java -jar plantuml.jar sequenceDiagram.txt

3.Alternative: Launch the Graphical User Interface and select the directory that contains the text files:

java -jar plantuml.jar -gui

Upon execution, a sequenceDiagram.png containing the sequence diagram will be generated.

Explore PlantUML to further your diagramming capabilities.

Using Docker

Using Docker to test PlantUML provides an isolated environment without requiring a direct installation of PlantUML or its dependencies on your machine.

Instructions

  1. Pull the PlantUML Docker Image

There's an official Docker image for PlantUML available on Docker Hub.

docker pull plantuml/plantuml-server:jetty

This command pulls the PlantUML server image using Jetty as the server.

2. Run the PlantUML Server Container

Once the image is downloaded, you can run a container based on this image.

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

This command does the following:

3. Access PlantUML Server

Once the container is running, you can access the PlantUML server in your browser by visiting http://localhost:8080/.

You should see the PlantUML server's user interface, which allows you to type PlantUML code and see the visual representation on the fly.

4. Test Your PlantUML Code

In the PlantUML server interface:

5. Stop the Container (when done)

When you're done testing your PlantUML diagrams, you might want to stop the running Docker container. First, identify the container ID:

docker ps

This command lists all running containers. Look for the plantuml/plantuml-server:jetty image in the list and note the container ID.

Now, you can stop the container:

docker stop [CONTAINER_ID]

Replace [CONTAINER_ID] with the ID of your running PlantUML container.

6. Remove the Container (optional)

If you want to remove the container entirely:

docker rm [CONTAINER_ID]

This command removes the stopped container from your machine.

PlantUML Integration Capabilities

Over the years (since 2009!), the tool has been integrated with a variety of platforms and tools, offering users flexibility and ease of use.

Here's a summary of PlantUML's integration capabilities.

PlantUML Language Reference Guide

For an in-depth understanding of PlantUML, the PlantUML Language Reference Guide is available.

This guide provides comprehensive insights into the language, from basic syntax to advanced techniques. It's a valuable resource for all users. Acquire your copy and expand your diagramming knowledge.