When plantuml.com’s online service isn’t reliable — flaky network, security policies — self-host the renderer. Three patterns: local jar, Docker, full microservice.
PlantUML server is stateless; pod reschedules don’t drop data. For fully-offline images, vendor fonts:
1 2
FROM plantuml/plantuml-server:latest RUN apt-get install -y fonts-noto-cjk
Common gotchas
1. CORS rejects browser fetches
1
Access to fetch at 'https://plantuml...' from origin 'https://editor...' has been blocked by CORS
Fix:
Set PLANTUML_SECURITY_PROFILE=INTERNET
Or add CORS headers at the Ingress / reverse proxy layer
2. URL length cap
Default MAX_URL_LENGTH is 4096 bytes; complex diagrams exceed it. Bump:
1
-e MAX_URL_LENGTH=8192
Or switch to POST form.
3. JVM OOM on large diagrams
1 2 3
resources: limits: memory:"1Gi"
1
-e JAVA_OPTS="-Xmx1g"
4. CJK tofu (square boxes) on default OpenJDK
1
RUN apt-get update && apt-get install -y fonts-noto-cjk
Render with bundled fonts after that.
Self-hosted vs plantuml.com
Dimension
Self-hosted
plantuml.com
Network
Internal
Public
Latency
Sub-ms in cluster
Internet-dependent
Privacy
Fully private
Submits to third party
Reliability
You control SLA
Their outage
Version lock
You decide
Always latest
Maintenance
One K8s Service
Zero
TL;DR
Self-hosted PlantUML server is the shared rendering backbone for CI, editors, and team wiki. Standard image + K8s autoscaling + CORS + CJK fonts is the four-piece recipe to ship into production.
Title: PlantUML self-hosting: from plantuml.jar to Docker to enterprise K8s