Home > Software > How to Deploy PlantUML with Docker Compose: A Guide for Streamlined Diagram Creation

How to Deploy PlantUML with Docker Compose: A Guide for Streamlined Diagram Creation

Anastasios Antoniadis

Master deploying PlantUML using Docker Compose with our detailed guide. Streamline the creation of UML diagrams in your development projects, enhancing documentation and collaboration effortlessly.

Docker (1)

PlantUML is a versatile tool that allows users to create diagrams using plain text. It supports various types of diagrams, including sequence diagrams, use case diagrams, class diagrams, activity diagrams, and more, making it an invaluable resource for developers, project managers, and anyone needing to create technical diagrams quickly. Running PlantUML in a Docker container simplifies the installation process and ensures consistency across different environments. This guide will demonstrate how to deploy PlantUML using Docker Compose, facilitating an easy setup for your diagramming needs.

Prerequisites

Before beginning, ensure you have the following:

  • Docker installed on your system.
  • Docker Compose installed on your system.
  • A basic understanding of Docker and Docker Compose.

Step 1: Create a Docker Compose File

Start by creating a directory dedicated to your PlantUML deployment. This directory will contain your Docker Compose file (docker-compose.yml) and any additional configuration or resources you may need.

mkdir plantuml-docker && cd plantuml-docker

Next, create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and add the following configuration:

version: '3.8'
services:
  plantuml:
    image: plantuml/plantuml-server:jetty
    container_name: plantuml_server
    ports:
      - "8080:8080"

Configuration Explained:

  • image: Specifies the Docker image to use. plantuml/plantuml-server:jetty is the official PlantUML Server image based on Jetty.
  • container_name: Sets a custom name for your container for easier reference.
  • ports: Exposes port 8080 on the host, mapping it to port 8080 in the container, where the PlantUML server listens for HTTP requests.

Step 2: Launch PlantUML Server

With your docker-compose.yml file in place, you can start the PlantUML server by running:

docker compose up -d

This command pulls the necessary Docker image and starts the PlantUML server in detached mode.

Step 3: Access PlantUML Server

After a few moments, the PlantUML server will be up and running. Access the PlantUML server’s web interface by navigating to http://localhost:8080 in your web browser. Here, you can start creating diagrams immediately using PlantUML syntax. The web interface provides an interactive environment where you can write your PlantUML code and see the diagram it generates in real-time.

Conclusion

Deploying PlantUML with Docker Compose offers a straightforward and efficient method for setting up a PlantUML server, enabling you to create various diagrams from plain text descriptions. Following the steps outlined in this guide, you can quickly have a PlantUML instance running on your machine, ready to generate technical diagrams for documentation, presentations, or any other needs. Docker Compose simplifies the management of the PlantUML service, ensuring that your diagramming tool is easily accessible and consistently configured across different environments. Whether you’re a software developer, an architect, or someone who frequently works with technical diagrams, a Dockerized PlantUML server can significantly streamline your workflow.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x