
Deploy LibreTranslate | (Just Updated) Translation API, Key-Locked, Models Survive Redeploys
LibreTranslate translation API, key-locked. Models survive redeploys
libretranslate
Just deployed
/home/libretranslate/.local
Deploy and Host LibreTranslate on Railway
LibreTranslate is a self-hosted machine translation API. It translates text, detects languages and translates documents using open Argos Translate models, with no third-party translation service and no per-character fee. It ships a small web UI and a JSON API that drops into any app that currently calls a paid translation endpoint.
This template runs LibreTranslate 1.9.6 as a single service from a digest-pinned official image. The API is locked behind a key that Railway generates for you, and the downloaded language models are kept on a Railway volume.
About Hosting LibreTranslate
- API locked behind a generated key. The stock image answers anyone who can reach the URL, so a
public deployment is a free translation service for the whole internet, paid for by your Railway
usage. This template creates a random
LIBRETRANSLATE_API_KEYon deploy, runs the server in API-key-required mode and answers any translation request without a valid key with a 400. The web UI stays available: open it and paste the key into its API key box. - Models survive a redeploy. On every boot LibreTranslate downloads its language models, which takes several minutes for the full set. The models live on the volume, so a redeploy starts from disk instead of the network.
- Pinned to a release. The image is pinned by digest, so a redeploy never changes the version underneath your integration.
- Per-client rate limit. Requests are limited per client address, taken from the first entry of
X-Forwarded-For, which is the real caller on Railway.
Common Use Cases
- Translating user-generated content, support tickets or product catalogues inside your own app
- Replacing a paid translation API in a side project or an internal tool
- Language detection for incoming messages
- Private translation of documents that must not leave your infrastructure
Dependencies for LibreTranslate Hosting
- One Railway volume for the language models and the key database (created by the template)
Deployment Dependencies
- LibreTranslate documentation: https://docs.libretranslate.com
- Official image: https://hub.docker.com/r/libretranslate/libretranslate
Implementation Details
The first boot downloads the models and can take several minutes before the service answers. Call the API with the generated key:
curl -X POST https:///translate \
-H "Content-Type: application/json" \
-d '{"q":"Hello world","source":"en","target":"es","api_key":""}'
By default 12 languages are installed (English, Spanish, French, German, Portuguese, Italian,
Japanese, Chinese, Korean, Russian, Arabic and Hindi, about 2.8 GB on the volume). The full set of
100 models needs well over 10 GB and does not fit a default volume, so to change the selection add
a LT_LOAD_ONLY variable with a comma-separated list such as en,es,fr and size the volume to
match. The start command logs the user id, data directory owner and language selection on every
boot.
Why Deploy LibreTranslate 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 LibreTranslate 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
libretranslate
libretranslate/libretranslate:v1.9.6RAILWAY_RUN_UID
