Installing using Docker¶
With dockerized Weblate deployment you can get your personal Weblate instance up and running in seconds. All of Weblate’s dependencies are already included. PostgreSQL is set up as the default database.
Weblate should run on all contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
- 2 GB of RAM
- 2 CPU cores
- 1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
The following examples assume you have a working Docker environment, with
docker-compose installed. Please check the Docker documentation for instructions.
Clone the weblate-docker repo:
git clone https://github.com/WeblateOrg/docker-compose.git weblate-docker cd weblate-docker
docker-compose.override.ymlfile with your settings. See Docker environment variables for full list of environment variables.
version: '3' services: weblate: ports: - 80:8080 environment: WEBLATE_EMAIL_HOST: smtp.example.com WEBLATE_EMAIL_HOST_USER: user WEBLATE_EMAIL_HOST_PASSWORD: pass WEBLATE_SERVER_EMAIL: [email protected] WEBLATE_DEFAULT_FROM_EMAIL: [email protected] WEBLATE_ALLOWED_HOSTS: weblate.example.com,localhost WEBLATE_ADMIN_PASSWORD: password for the admin user WEBLATE_ADMIN_EMAIL: [email protected]
WEBLATE_ADMIN_PASSWORDis not set, the admin user is created with a random password shown on first startup.
Append ‘,localhost’ to
WEBLATE_ALLOWED_HOSTSto be able to access locally for testing.
You may also need to edit the docker-compose.yml file and change the default port from 80 if you already have a web server running on your local machine.
Start Weblate containers:
Enjoy your Weblate deployment, it’s accessible on port 80 of the
Changed in version 2.15-2: The setup has changed recently, priorly there was separate web server container, since 2.15-2 the web server is embedded in the Weblate container.
Changed in version 3.7.1-6: In July 2019 (starting with the 3.7.1-6 tag), the containers is not running as a root user. This has lead to changed exposed port from 80 to 8080.
Docker container with HTTPS support¶
Please see Installation for generic deployment instructions, this section only mentions differences compared to it.
Using own SSL certificates¶
New in version 3.8-3.
In case you have own SSL certificate you want to use, simply place the files into the Weblate data volume (see Docker container volumes):
ssl/fullchain.pemcontaining the certificate including any needed CA certificates
ssl/privkey.pemcontaining the private key
Additionally, Weblate container will now accept SSL connections on port 4443, you will want to include the port forwarding for HTTPS in docker compose override:
version: '3' services: weblate: ports: - 80:8080 - 443:4443
Automatic SSL certificates using Let’s Encrypt¶
In case you want to use Let’s Encrypt
automatically generated SSL certificates on public installation, you need to
add a reverse HTTPS proxy an additional Docker container, https-portal will be used for that.
This is made use of in the
docker-compose-https.yml file. Then create
docker-compose-https.override.yml file with your settings:
version: '3' services: weblate: environment: WEBLATE_EMAIL_HOST: smtp.example.com WEBLATE_EMAIL_HOST_USER: user WEBLATE_EMAIL_HOST_PASSWORD: pass WEBLATE_ALLOWED_HOSTS: weblate.example.com WEBLATE_ADMIN_PASSWORD: password for admin user https-portal: environment: DOMAINS: 'weblate.example.com -> http://weblate:8080'
Whenever invoking docker-compose you need to pass both files to it, and then do:
docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml build docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml up
Upgrading the Docker container¶
Usually it is good idea to only update the Weblate container and keep the PostgreSQL container at the version you have, as upgrading PostgreSQL is quite painful and in most cases does not bring many benefits.
You can do this by sticking with the existing docker-compose and just pull the latest images and then restart:
docker-compose stop docker-compose pull docker-compose up
The Weblate database should be automatically migrated on first startup, and there should be no need for additional manual actions.
Upgrades across 3.0 are not supported by Weblate. If you are on 2.x series
and want to upgrade to 3.x, first upgrade to the latest 3.0.1-x (at time of
writing this it is the
3.0.1-7) image, which will do the migration and then
continue upgrading to newer versions.
You might also want to update the
docker-compose repository, though it’s
not needed in most case. Please beware of PostgreSQL version changes in this
case as it’s not straightforward to upgrade the database, see GitHub issue for more info.
Docker environment variables¶
Many of Weblate’s Configuration can be set in the Docker container using environment variables:
Configures Django debug mode using
environment: WEBLATE_DEBUG: 1
Configures the logging verbosity.
Configures the site-title shown on the heading of all pages.
Configures the site-admin’s name and e-mail.
environment: WEBLATE_ADMIN_NAME: Weblate admin WEBLATE_ADMIN_EMAIL: [email protected]
Sets the password for the admin user. If not set, the admin user is created with a random password shown on first startup.
Configures the address for outgoing e-mails.
Configures allowed HTTP hostnames using
ALLOWED_HOSTSand sets sitename to the first one.
environment: WEBLATE_ALLOWED_HOSTS: weblate.example.com,example.com
Configures the secret used by Django for cookie signing.
Deprecated since version 2.9: The secret is now generated automatically on first startup, there is no need to set it manually.
Configures whether registrations are open by toggling
environment: WEBLATE_REGISTRATION_OPEN: 0
Configures the used time zone in Weblate, see
To change the time zone of the Docker container itself, use the
environment: WEBLATE_TIME_ZONE: Europe/Prague
Makes Weblate assume it is operated behind a reverse HTTPS proxy, it makes Weblate use HTTPS in e-mail and API links or set secure flags on cookies.
This does not make the Weblate container accept HTTPS connections, you need to configure that as well, see Docker container with HTTPS support for examples.
environment: WEBLATE_ENABLE_HTTPS: 1
Lets Weblate fetch the IP address from any given HTTP header. Use this when using a reverse proxy in front of the Weblate container.
The format must conform to Django’s expectations. Django transforms raw HTTP header names as follows:
- converts all characters to uppercase
- replaces any hyphens with underscores
X-Forwarded-Forwould be mapped to
environment: WEBLATE_IP_PROXY_HEADER: HTTP_X_FORWARDED_FOR
Configures login required for the whole of the Weblate installation using
environment: WEBLATE_REQUIRE_LOGIN: 1
Adds URL exceptions for login required for the whole Weblate installation using
Configures GitHub username for GitHub pull-requests by changing
Configures GitLab username for GitLab merge-requests by changing
Configures GPG signing of commits, see
Machine translation settings¶
environment: WEBLATE_MT_MYMEMORY_ENABLED: 1
Enables Glosbe machine translation.
environment: WEBLATE_MT_GLOSBE_ENABLED: 1
Enables Microsoft Terminology Service machine translation.
environment: WEBLATE_MT_MICROSOFT_TERMINOLOGY_ENABLED: 1
LDAP authentication configuration.
environment: WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org WEBLATE_AUTH_LDAP_USER_DN_TEMPLATE: uid=%(user)s,ou=People,dc=example,dc=net # map weblate 'full_name' to ldap 'name' and weblate 'email' attribute to 'mail' ldap attribute. # another example that can be used with OpenLDAP: 'full_name:cn,email:mail' WEBLATE_AUTH_LDAP_USER_ATTR_MAP: full_name:name,email:mail
Azure Active Directory¶
Azure Active Directory with Tenant support¶
You can enable authentication using Linux vendors authentication services by setting following variables to any value.
PostgreSQL database setup¶
The database is created by
docker-compose.yml, so these settings affect
both Weblate and PostgreSQL containers.
PostgreSQL database name.
PostgreSQL server hostname or IP address. Defaults to
PostgreSQL server port. Defaults to none (uses the default value).
Caching server setup¶
Using Redis is strongly recommended by Weblate and you have to provide a Redis instance when running Weblate in Docker.
The Redis server hostname or IP address. Defaults to
The Redis server port. Defaults to
The Redis database number, defaults to
The Redis server password, not used by default.
Enables using SSL for Redis connection.
Can be used to disable SSL certificate verification for Redis connection.
Email server setup¶
To make outgoing e-mail work, you need to provide a mail server.
Mail server, the server has to listen on port 587 and understand TLS.
Mail server port. Use if your cloud provider or ISP blocks outgoing connections on port 587.
Email authentication user, do NOT use quotes here.
Email authentication password, do NOT use quotes here.
Whether to use an implicit TLS (secure) connection when talking to the SMTP server. In most e-mail documentation, this type of TLS connection is referred to as SSL. It is generally used on port 465. If you are experiencing problems, see the explicit TLS setting
It is recommended to collect errors from the installation systematically, see Collecting error reports.
To enable support for Rollbar, set the following:
Your Rollbar post server access token.
Your Rollbar environment, defaults to
To enable support for Sentry, set following:
Your Sentry DSN.
Changing enabled apps, checks, addons or autofixes¶
New in version 3.8-5.
The built in configuration of enabled checks, addons or autofixes can be adjusted by following variables:
Example:environment: WEBLATE_REMOVE_AUTOFIX: weblate.trans.autofixes.whitespace.SameBookendingWhitespace WEBLATE_ADD_ADDONS: customize.addons.MyAddon,customize.addons.OtherAddon
Docker container volumes¶
There is single data volume exported by the Weblate container. The other service containers (PostgreSQL or Redis) have their data volumes as well, but those are not covered by this document.
The data volume is used to store Weblate persistent data such as cloned repositories or to customize Weblate installation.
The placement of the Docker volume on host system depends on your Docker
configuration, but usually it is stored in
/var/lib/docker/volumes/weblate-docker_weblate-data/_data/. In the
container it is mounted as
Further configuration customization¶
You can further customize Weblate installation in the data volume, see Docker container volumes.
Custom configuration files¶
You can additionally override the configuration in
/app/data/settings-override.py (see Docker container volumes). This is
executed after all environment settings are loaded, so it gets completely set
up, and can be used to customize anything.
Replacing logo and other static files¶
New in version 3.8-5.
The static files coming with Weblate can be overridden by placing into
/app/data/python/customize/static (see Docker container volumes). For
replace the favicon.
The files are copied to correspoding location on container startup, so restart is needed after changing the volume content.
Alternatively you can also include own module (see Customizing Weblate) and add it as separate volume to the Docker container, for example:
weblate: volumes: - weblate-data:/app/data - ./weblate_customization/weblate_customization:/app/data/python/weblate_customization environment: WEBLATE_ADD_APPS: weblate_customization
In order to use the GitHub’s pull-request feature, you must initialize hub configuration by entering the Weblate container and executing an arbitrary Hub command. For example:
docker-compose exec --user weblate weblate bash cd HOME=/app/data/home hub clone octocat/Spoon-Knife
The username passed for credentials must be the same as
In order to use GitLab’s merge-request feature, you must initialize
configuration by entering the weblate contained and executing
command. For example:
docker-compose exec --user weblate weblate bash cd HOME=/app/data/home lab
access_token passed for lab configuratoin must be same as
Select your machine - local or cloud providers¶
With docker-machine you can create your Weblate deployment either on your local machine, or on any large number of cloud-based deployments on e.g. Amazon AWS, Greenhost, and many other providers.