Deploy a free, open-source translation API on your own server — no API keys, no rate limits, full privacy for your translation needs.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/tools/libretranslate/libretranslate-ubuntu.sh
chmod +x libretranslate-ubuntu.sh
sudo bash libretranslate-ubuntu.sh
The script installs Docker if not already present, pulls the LibreTranslate image, and starts the container with all required language models. The initial startup may take a few minutes while language packs are downloaded.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/tools/libretranslate/libretranslate-ubuntu.sh
chmod +x libretranslate-ubuntu.sh
sudo bash libretranslate-ubuntu.sh
Open your browser and navigate to the LibreTranslate web interface to test translations interactively:
http://<your-server-ip>:5000
Use the built-in interactive API explorer at the web UI, or send direct HTTP requests to test the translation endpoint. The API accepts JSON with the source text, source language, and target language.
curl -X POST http://<your-server-ip>:5000/translate \
-H "Content-Type: application/json" \
-d '{"q":"Hello","source":"en","target":"ar"}'
Call the REST API from any programming language by sending POST requests with the source and target language codes. Replace <your-server-ip> with your server's IP address in your application configuration. The API is compatible with many LibreTranslate client libraries available for Python, JavaScript, PHP, and more.
curl -X POST http://<your-server-ip>:5000/translate \
-H "Content-Type: application/json" \
-d '{"q":"Hello","source":"en","target":"ar"}'
| Port | Purpose |
|---|---|
| 5000 | LibreTranslate API & Web UI |
LibreTranslate is a free and open-source machine translation API powered by the Argos Translate engine. It supports translation between dozens of languages and provides a REST API compatible with applications, scripts, and browser extensions — all without sending data to Google or DeepL.
Self-hosting LibreTranslate eliminates per-character API fees from commercial providers and keeps translated content private. It is ideal for internal document translation workflows, adding translation to existing apps, or complying with data residency requirements.
LibreTranslate runs on port 5000. If used internally, keep this port firewalled from the public internet and access via VPN. For public-facing APIs, place it behind a reverse proxy with API key enforcement and rate limiting.
Alternatives include Google Translate API (cloud, per-character cost), DeepL API (higher quality, paid), Lingvanex (self-hostable, commercial), and Argos Translate (Python library only). Choose LibreTranslate for a REST API with a web UI and Docker deployment.
Avoid LibreTranslate if translation quality is critical — commercial engines like DeepL produce significantly better results especially for professional or published content. Also avoid on low-RAM servers as each language pair model requires substantial memory.
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
LibreTranslate uses the Argos Translate engine which provides decent quality for common language pairs like English-Spanish or English-French. Quality is lower than DeepL or Google Translate, especially for complex sentences or less common languages. It is best suited for internal, draft, or automated translation rather than published content.
Languages are added by downloading Argos Translate model packages. In the LibreTranslate admin panel, go to Languages and install the language pairs you need. Each pair such as English-to-Arabic is a separate model file that must be downloaded, requiring internet access for initial setup.
Yes. LibreTranslate provides a REST API. Send a POST request to /translate with a JSON body containing the source text, source language code, and target language code. The API returns the translated text. Full documentation is available at the /docs path on your instance.
Yes — once language models are downloaded during setup, LibreTranslate operates fully offline. No internet connection is required for translation. This makes it suitable for air-gapped environments after initial model installation.
Enable API key authentication by setting the LT_API_KEYS=true environment variable. Then create API keys via the admin panel. All requests must include a valid api_key parameter. You can set per-key rate limits to prevent abuse.