Deploy Gotenberg
API to convert HTML, URLs and Office files to PDF, with basic auth
Gotenberg
Just deployed
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-datawith basic auth
Deployment Dependencies
- Gotenberg documentation: https://gotenberg.dev/docs/getting-started/introduction
- Gotenberg 9.5.1 release: https://github.com/gotenberg/gotenberg/releases/tag/v9.5.1
- Template repo: https://github.com/aalfath/gotenberg-railway-template
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
Gotenberg
aalfath/gotenberg-railway-template