---
title: "Deploy Kroki"
description: "Authenticated text-to-diagram rendering API"
category: "Other"
url: https://railway.com/deploy/kroki-secure
---

# Deploy Kroki

Authenticated text-to-diagram rendering API

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

- **Creator:** Tom
- **Category:** Other

## Template content

### proxy https://raw.githubusercontent.com/monotykamary/railway-template-kroki/de531b36f594c49909e948caa81ff438ac4971f1/assets/kroki-icon.png

- **Source:** https://github.com/monotykamary/railway-template-kroki
- **Health check:** /healthz
- **Public domain:** Yes

### kroki https://raw.githubusercontent.com/monotykamary/railway-template-kroki/de531b36f594c49909e948caa81ff438ac4971f1/assets/kroki-icon.png

- **Source:** https://github.com/monotykamary/railway-template-kroki
- **Health check:** /health

## Documentation

# Deploy and Host Kroki on Railway

## About Hosting Kroki

Kroki provides a unified HTTP API that turns text descriptions into SVG, PNG, PDF, and other diagram formats. This template deploys stable Kroki 0.32.1 privately behind an authenticated Caddy proxy.

Retrieve `BASIC_AUTH_USER` and the generated `BASIC_AUTH_PASSWORD` from the proxy service before calling rendering endpoints. Kroki 0.32.1 includes the secure-mode fix for nested Vega URL SSRF and local-file reads.

## Common Use Cases

- Render architecture and dependency diagrams in documentation pipelines
- Generate GraphViz, PlantUML, Ditaa, Vega, and WaveDrom assets
- Provide a private diagram API for CI and internal tools

## Dependencies for Kroki Hosting

### Deployment Dependencies

- Private Kroki gateway service
- Public Caddy authentication proxy
- No database or persistent volume

### Implementation Details

Railway HTTPS routes to Caddy on port 8080. Caddy enforces generated HTTP Basic credentials, limits source bodies to 2 MB, and forwards requests over Railway private networking to Kroki on port 8000. `/healthz` checks Kroki's own `/health` response.

This minimal deployment includes only renderers bundled into the core Kroki image. Optional Mermaid, BPMN, Excalidraw, and diagrams.net companion services are deliberately excluded rather than pretending those formats work.

## Why Deploy Kroki on Railway?

Railway provides managed HTTPS, generated credentials, private networking, health checks, and reproducible deployment for a stateless diagram-rendering API.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] 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-secure
