Configuring GitLab 13.1.11 to Support PlantUML Diagrams

System Requirements

  • GitLab Version: 13.1.11
  • PlantUML Version: 1.2023.10
  • Graphviz Version: 8.1.0

Deployment Architecture

PlantUML is deployed separately from GitLab on Anolis OS 7.9. The PlantUML server is compiled from source into a WAR package and deployed using Tomcat 10 with Oracle JDK 11.0.6. Graphviz is compiled and installed from source. PlantUML provides diagram rendering services to GitLab via HTTPS protocol.

Implementation Steps

1. Install Required Dependencies

yum -y install expat expat-devel glibc-common fonts-arphic-uming kde-l10n-Chinese

2. Install Graphviz

tar zxvf graphviz-8.1.0.tar.gz
cd graphviz-8.1.0/
./configure --prefix=/usr/local/graphviz-8.1.0
mkdir -p /opt/local
ln -s /usr/local/graphviz-8.1.0/bin /opt/local/bin

3. Set Up Application Server

Install Tomcat 10 and JDK 11.0.6 (standard installation procedure).

4. Build PlantUML Server

wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar zxvf apache-maven-3.8.8-bin.tar.gz
mv apache-maven-3.8.8 /usr/local/
echo 'export PATH=$PATH:/usr/local/apache-maven-3.8.8/bin' >> /etc/profile
source /etc/profile

git clone https://github.com/plantuml/plantuml-server.git
cd plantuml-server
mvn package

5. Deploy PlantUML Application

Copy the generated WAR file from the target directory to Tomcat's webapps directory and start the Tomcat service.

6. Configure SSL/TLS

Set up Nginx with HTTPS configuration to proxy requests to the PlantUML service (can also be configured directly in Tomcat).

7. Configure GitLab Integration

vim /etc/gitlab/gitlab.rb

# Add the following configuration:
nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/(plantuml.*) /$1 break;\n proxy_cache off; \n proxy_pass https://your-domain.com/plantuml; \n}\n"
gitlab_rails['env'] = { 'PLANTUML_ENCODING' => 'deflate' }

8. Enable PlantUML in GitLab Admin

Log into GitLab as administrator, navigate to Admin Area → Settingss → Integrations → PlantUML, and enter the PlantUML server URL (e.g., https://you're-domain.com/plantuml).

9. Test Integration

Use PlantUML demo diagrams in GitLab markdown files by wrapping PlantUML code with plantuml tags.

Troubleshooting Notes

  • Chinese character encoding issues: Configure UTF-8 character set in Tomcat and install Chinese font packages on the PlantUML server
  • Missing diagram elements: Ensure Graphviz version compatibility with PlantUML - tested versions work correctly
  • Browser display problems: HTTPS configuration is required for modern browsers like Chrome

Tags: gitlab PlantUML Graphviz Tomcat nginx

Posted on Sun, 05 Jul 2026 16:44:00 +0000 by jp2php