Deploying Weblate
Introduction
Weblate is a powerful, self-hosted web-based translation management system designed for software localization. It integrates tightly with version control systems, allowing translators to work directly with your codebase while developers can easily pull in new translations.
Built with Python and Django, Weblate provides a comprehensive platform for managing translations across multiple projects and languages, with features that support both individual translators and large translation teams.
Key features of Weblate include:
- Version Control Integration: Native support for Git, Mercurial, and Subversion
- Translation Memory: Share translations across projects to improve consistency
- Machine Translation: Integration with DeepL, Google Translate, and other MT services
- Quality Checks: Automatic quality assurance for translations
- Glossary Support: Maintain terminology consistency across projects
- File Format Support: Support for PO, XLIFF, JSON, Android, iOS, and many more
- Collaborative Workflow: Review, approval, and commenting features
- Automatic Translation: Propagate translations across similar strings
- Statistics and Reports: Track translation progress and contributor activity
- API Access: Comprehensive REST API for automation
- SSO Support: LDAP, SAML, and OAuth authentication
This guide walks you through deploying Weblate on Klutch.sh using Docker for translation management.
Prerequisites
Before deploying Weblate on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- A PostgreSQL database (managed or deployed separately)
- A Redis instance (for caching and background tasks)
- Basic familiarity with Docker and localization concepts
Repository Structure
Create a GitHub repository with the following structure:
weblate-deploy/├── Dockerfile└── .dockerignoreDockerfile
Create a Dockerfile in your repository:
FROM weblate/weblate:latest
# Web interface portEXPOSE 8080
# The base image handles the entrypointEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
WEBLATE_SITE_DOMAIN | Yes | - | Your Weblate domain |
WEBLATE_SITE_TITLE | No | Weblate | Site title |
POSTGRES_HOST | Yes | - | PostgreSQL host |
POSTGRES_PORT | No | 5432 | PostgreSQL port |
POSTGRES_DATABASE | Yes | - | Database name |
POSTGRES_USER | Yes | - | Database user |
POSTGRES_PASSWORD | Yes | - | Database password |
REDIS_HOST | Yes | - | Redis host |
REDIS_PORT | No | 6379 | Redis port |
WEBLATE_ADMIN_EMAIL | Yes | - | Admin email |
WEBLATE_ADMIN_PASSWORD | Yes | - | Initial admin password |
WEBLATE_EMAIL_HOST | No | - | SMTP host for notifications |
WEBLATE_SECRET_KEY | Yes | - | Django secret key |
Deployment on Klutch.sh
- Push your Dockerfile to your GitHub repository.
- Log in to Klutch.sh and create a new project.
- Create a new app within your project and connect your GitHub repository containing the Dockerfile.
- Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **8080**
- Add environment variables: - `WEBLATE_SITE_DOMAIN`: Your app domain - `POSTGRES_HOST`, `POSTGRES_DATABASE`, `POSTGRES_USER`, `POSTGRES_PASSWORD`: Database credentials - `REDIS_HOST`: Redis server address - `WEBLATE_ADMIN_EMAIL`, `WEBLATE_ADMIN_PASSWORD`: Admin credentials - `WEBLATE_SECRET_KEY`: A secure random string
- Attach persistent volumes: - Mount path: `/app/data` - Recommended size: 20 GB - Purpose: Git repositories and uploaded files
- Click **Deploy** and wait for the build to complete.
- Access your Weblate instance and log in with your admin credentials.
Post-Deployment Configuration
After deployment:
- Log in with your admin credentials
- Create your first project
- Add components (translation files from repositories)
- Configure machine translation services if desired
- Invite translators and set up access control
Troubleshooting
Database Connection Issues
Verify PostgreSQL credentials and ensure the database is accessible from Klutch.sh.
Background Tasks Not Running
Ensure Redis is properly configured and accessible.
Git Operations Failing
Check that SSH keys are configured if using private repositories.