---
title: "Deploy Kroki"
description: "Kroki 0.32 diagrams-as-a-service API with Mermaid companion service."
category: "Other"
url: https://railway.com/deploy/kroki
---

# Deploy Kroki

Kroki 0.32 diagrams-as-a-service API with Mermaid companion service.

**[Deploy Kroki on Railway](https://railway.com/template/kroki)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/kroki/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### kroki https://github.com/yuzutech.png

- **Image:** yuzutech/kroki:0.32.1
- **Health check:** /health
- **Public domain:** Yes

### mermaid https://github.com/mermaid-js.png

- **Image:** yuzutech/kroki-mermaid:0.32.1

## Documentation

# Deploy and Host Kroki on Railway

Kroki turns textual diagram descriptions into images through one HTTP API. It supports PlantUML, GraphViz, Mermaid, C4, D2, BlockDiag, Ditaa, Nomnoml, Structurizr, WaveDrom and many more formats, returning SVG, PNG or PDF, which makes it easy to render diagrams in docs, wikis, chat bots and CI pipelines.

## About Hosting Kroki

This template deploys Kroki v0.32.1 with the Mermaid companion service, which Kroki calls over Railway's private network. The Kroki service has a public domain; the Mermaid renderer stays private. Kroki keeps no state and has no secrets, so like the public kroki.io service it is open to anyone who knows the URL, which is fine for rendering but worth keeping in mind for heavy traffic. The default safe mode blocks file includes and network access from diagram sources. Memory use is moderate; the Hobby plan is enough for normal use.

## Common Use Cases

- Rendering PlantUML, Mermaid and GraphViz diagrams in docs sites and wikis
- Diagram images in README badges, chat bots and pull request comments
- A private replacement for kroki.io inside your own infrastructure

## Dependencies for Kroki Hosting

- `yuzutech/kroki:0.32.1` (official image)
- `yuzutech/kroki-mermaid:0.32.1` companion (private)

### Deployment Dependencies

- [Kroki documentation](https://docs.kroki.io/kroki/)
- [Kroki v0.32.1 release](https://github.com/yuzutech/kroki/releases/tag/v0.32.1)
- [Supported diagram types](https://kroki.io/#support)
- [Railway private networking](https://docs.railway.com/reference/private-networking)

### Implementation Details

| Service | Image | Networking | Storage |
| --- | --- | --- | --- |
| kroki | `yuzutech/kroki:0.32.1` | public domain on 8000 | none |
| mermaid | `yuzutech/kroki-mermaid:0.32.1` | private only, port 8002 | none |

```bash
curl -X POST "$KROKI_URL/graphviz/svg" -H "Content-Type: text/plain" --data 'digraph G { a -&gt; b }'
curl -X POST "$KROKI_URL/mermaid/svg" -H "Content-Type: text/plain" --data 'graph TD; A--&gt;B'
```

GET requests with a deflate + base64url encoded source also work, for use in Markdown image links.

Notes:

- Add other companions (BPMN, Excalidraw, diagrams.net) as extra services with the matching `yuzutech/kroki-*` image and `KROKI__HOST` variable.
- Keep `KROKI_SAFE_MODE` at its default (`secure`) on a public instance.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Kroki project or its maintainers.

## Why Deploy Kroki on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Kroki on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/kroki
