Access
- Open
http://<SERVER_IP>in a browser. - The API documentation is available at
/docs. - Use the generated API key for API requests. It is stored in
/root/libretranslate/.credentials.
API Usage
Example translation request:
curl -X POST http://<SERVER_IP>/translate \
-d q='Hello' \
-d source=en \
-d target=es \
-d api_key='<API_KEY>'
Replace <API_KEY> with the generated API key.
Configuration
The main environment variables are stored in /root/libretranslate/.env.
LT_VERSION: LibreTranslate image versionREQ_LIMIT: Maximum requests per minute per clientCHAR_LIMIT: Maximum characters allowed per request
Modify the configuration as needed.
After changing the configuration, apply it with:
cd /root/libretranslate
docker compose up -d
Important Files & Directories
- Install Path:
/root/libretranslate - Compose File:
/root/libretranslate/docker-compose.yml - Environment:
/root/libretranslate/.env - Credentials:
/root/libretranslate/.credentials - Models:
/var/lib/docker/volumes/libretranslate_models - Key DB:
/var/lib/docker/volumes/libretranslate_db - Caddy Config:
/etc/caddy/Caddyfile
Domain & HTTPS (Caddy)
0. HTTPS certificates cannot be issued for IP addresses.
1. Point a domain (for example, example.com) to your server's IP address.
2. Update /etc/caddy/Caddyfile:
example.com {
reverse_proxy localhost:5000
}
3. Reload Caddy:
systemctl reload caddy
4. Access LibreTranslate at example.com.
Notes
- Modify the configuration based on your preferences in
/root/libretranslate/.env. - Under Attack mode is enabled by default to help protect the public API from abusive or automated requests.
- Request limiting is enabled with a default limit of
60requests per minute per client. - Requests are limited to
5000characters by default. - The LibreTranslate container listens only on
127.0.0.1:5000; Caddy provides public access.