How to handle PlantUML


In this article, I introduce how to use plantUML.

Omg, I got the detailed reference with discription.


Build an environment

$ source ~/.zshrc
$ brew install graphviz adoptopenjdk plantuml

let's code in .pu file. Btw, the extension, .pu is so cute, is it? haha.

@startuml name

actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C

It's very easy because it is drawn on vscode:D
if you want to output as an image, you have to follow the steps below.

  1. ⌘ + Shift + P Open the command palette.
  2. Enter PlantUML: Export Current Diagram in the command palette.
    After reinstalling vscode, the preview disappeared in mystery, so I solved it as follows.
  3. Execute the following command.
$ docker run -d -p 8080:8080 plantuml/plantuml-server:jetty
  1. In preference → Plantuml: Render → PlantUMLServer、Plantuml: Server → http://localhost:8080/ 
    Then it was displayed and the image could be output.
    Reference article:


if you want to output an image, enter option+D