---
title: "Deploy LibreTranslate | (Just Updated) Translation API, Key-Locked, Models Survive Redeploys"
description: "LibreTranslate translation API, key-locked. Models survive redeploys"
category: "AI/ML"
url: https://railway.com/deploy/libretranslate-or-just-updated-translati
---

# Deploy LibreTranslate | (Just Updated) Translation API, Key-Locked, Models Survive Redeploys

LibreTranslate translation API, key-locked. Models survive redeploys

**[Deploy LibreTranslate | (Just Updated) Translation API, Key-Locked, Models Survive Redeploys on Railway](https://railway.com/template/libretranslate-or-just-updated-translati)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/libretranslate-or-just-updated-translati/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** AI/ML

## Template content

### libretranslate

- **Image:** libretranslate/libretranslate:v1.9.6@sha256:1de2d7056bb8ad607a412f4563d9abe324ff632b43b5be9428bcc8e213aebb32
- **Start command:** `/bin/sh -c 'set -e; cd /app; D=/home/libretranslate/.local; DB=$D/api_keys.db; mkdir -p "$D"; ./venv/bin/python -c "import sys;from libretranslate.api_keys import Database;Database(sys.argv[1]).add(600, sys.argv[2])" "$DB" "$LIBRETRANSLATE_API_KEY"; L="${LT_LOAD_ONLY:-en,es,fr,de,pt,it,ja,zh,ko,ru,ar,hi}"; echo "[railway] api key loaded uid=$(id -u) data=$(stat -c %u:%g "$D") port=${PORT:-5000} languages=$L"; exec ./scripts/entrypoint.sh --host 0.0.0.0 --port "${PORT:-5000}" --api-keys --api-keys-db-path "$DB" --under-attack --req-limit 120 --load-only "$L"'`
- **Public domain:** Yes

## Documentation

# 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_KEY` on 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:

```sh
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.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/libretranslate-or-just-updated-translati
