Deploy Gotenberg

API to convert HTML, URLs and Office files to PDF, with basic auth

Deploy Gotenberg

Deploy and Host Gotenberg on Railway

Gotenberg is an open-source, Docker-based API for making PDFs. Send it HTML, Markdown, a URL or an Office document (Word, Excel, PowerPoint and more) over HTTP and it returns a PDF, rendered with Chromium or LibreOffice. It also merges, splits, stamps, signs and converts PDFs to PDF/A and PDF/UA.

About Hosting Gotenberg

Gotenberg runs as a single container with Chromium and LibreOffice built in, and needs no database or disk: it converts each request and returns the result, so it stores nothing. This template builds Gotenberg 9.5.1 from a small GitHub repo that pins the official image by digest, listens on Railway's port, and turns on HTTP basic auth with a generated password so the public URL isn't an open conversion service. Railway's health check uses /health, which stays open. Your apps call the API over the public domain or the private network. Give the service enough memory for large documents, because Chromium and LibreOffice are memory-hungry.

Common Use Cases

  • Generate invoices, reports and receipts as PDFs from HTML templates in your app
  • Convert uploaded Word, Excel and PowerPoint files to PDF
  • Merge, split, watermark or archive PDFs (PDF/A, PDF/UA) in a document pipeline

Dependencies for Gotenberg Hosting

  • None beyond the Gotenberg service itself (no database, no volume)
  • An HTTP client in your app that sends multipart/form-data with basic auth

Deployment Dependencies

Implementation Details

The username is gotenberg and the password is generated at deploy time: read GOTENBERG_API_BASIC_AUTH_PASSWORD in the service's Variables tab. Every route except /health needs them.

curl -u gotenberg:YOUR-PASSWORD \
  --form files=@index.html \
  https://YOUR-DOMAIN/forms/chromium/convert/html -o out.pdf

The HTML file must be named index.html. From another service in the same project, call http://${{Gotenberg.RAILWAY_PRIVATE_DOMAIN}}:3000. Any Gotenberg flag can be set as a variable in upper case with underscores, for example API_TIMEOUT=120s, API_BODY_LIMIT=50MB or CHROMIUM_DENY_PRIVATE_IPS=true. Updates ship through the template repo, and Railway tells you when one is available.

Why Deploy Gotenberg 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 Gotenberg 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.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
View Template
Foundry Virtual Tabletop
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
52