<a id="install"></a>

# Instruções de configuração

## Instalando o Weblate

Dependendo da sua configuração e experiência, escolha um método de instalação apropriado para você:

* [Instalando usando Docker](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md), recomendado para configurações de produção.
* Instalação com virtualenv, recomendada para configurações de produção:
  * [Instalando no Debian e Ubuntu](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/venv-debian.md)
  * [Instalando no SUSE e openSUSE](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/venv-suse.md)
  * [Instalando no RedHat, Fedora e CentOS](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/venv-redhat.md)
  * [Instalando no macOS](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/venv-macos.md)
* [Instalando a partir do código-fonte](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/source.md), recomendado para o desenvolvimento.
* [Instalando no OpenShift](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/openshift.md)
* [Instalando no Kubernetes](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/kubernetes.md)

<a id="architecture"></a>

## Visão geral da arquitetura

Servidor Web
: Tratamento de solicitações HTTP de entrada, [Servindo arquivos estáticos](#static-files).

Trabalhadores do Celery
: [Tarefas de fundo usando Celery](#celery) são executados aqui.
  <br/>
  Dependendo da sua carga de trabalho, você pode querer personalizar o número de trabalhadores.
  <br/>
  Use um nó dedicado ao escalar o Weblate horizontalmente.

Application server
: A WSGI or ASGI server serving web pages to users.
  <br/>
  Use um nó dedicado ao escalar o Weblate horizontalmente.

Banco de dados
: Servidor de banco de dados PostgreSQL para armazenar todo o conteúdo, consulte: [Configuração de banco de dados para o Weblate](#database-setup).
  <br/>
  Use um nó de banco de dados dedicado para sites com centenas de milhões de palavras hospedadas.

Datastore
: Key/value datastore such as Valkey or Redis server for cache and tasks queue, see [Tarefas de fundo usando Celery](#celery).
  <br/>
  Use um nó dedicado ao escalar o Weblate horizontalmente.

Sistema de arquivos
: Armazenamento do sistema de arquivos para armazenar repositórios do VCS e dados de usuário enviados. Isso é compartilhado por todos os processos.
  <br/>
  Use armazenamento em rede ao escalar o Weblate horizontalmente.

Servidor de e-mail
: Servidor SMTP para e-mail de saída, consulte [Configuração de e-mail de saída](#out-mail). Ele pode ser fornecido externamente.

#### HINT
[Instalando usando Docker](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md) includes PostgreSQL and Valkey, making the installation easier.

<a id="requirements"></a>

## Requisitos de software

### Sistema operacional

Weblate é conhecido por funcionar no Linux, FreeBSD e macOS. Outros sistemas como o Unix provavelmente funcionarão também.

O Weblate não é suportado no Windows. Mas ainda pode funcionar e patches são aceitos alegremente.

#### SEE ALSO
[Visão geral da arquitetura](#architecture) descreve a arquitetura geral do Weblate e os serviços necessários.

<a id="python-deps"></a>

### Dependências Python

Weblate is written in [Python](https://www.python.org/) and supports Python
3.12 or newer. You can install dependencies using pip or from your
distribution packages, full list is available in `requirements.txt`.

As dependências mais notáveis:

Django
: [https://www.djangoproject.com/](https://www.djangoproject.com/)

Celery
: [https://docs.celeryq.dev/](https://docs.celeryq.dev/)

Translate Toolkit
: [https://toolkit.translatehouse.org/](https://toolkit.translatehouse.org/)

translation-finder
: [https://github.com/WeblateOrg/translation-finder](https://github.com/WeblateOrg/translation-finder)

Python Social Auth
: [https://python-social-auth.readthedocs.io/](https://python-social-auth.readthedocs.io/)

Django REST Framework
: [https://www.django-rest-framework.org/](https://www.django-rest-framework.org/)

<!-- Table is generated using scripts/show-extras.py -->

#### Dependências opcionais

| Especificador da dependência opcional   | Pacotes Python                                                                                                                                                            | Recurso Weblate                                                                                                                     |
|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| `amazon`                                | [boto3](https://pypi.org/project/boto3/)<br/><br/><br/>[django-ses](https://pypi.org/project/django-ses/)<br/><br/>                                                       | [Amazon Translate](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/machine.md#mt-aws), AWS SES e-mail backend                                      |
| `asgi`                                  | [granian](https://pypi.org/project/granian/)<br/><br/>                                                                                                                    | ASGI server for Weblate                                                                                                             |
| `gelf`                                  | [logging-gelf](https://pypi.org/project/logging-gelf/)<br/><br/>                                                                                                          | [Gerenciamento de logs Graylog](#graylog)                                                        |
| `gerrit`                                | [git-review](https://pypi.org/project/git-review/)<br/><br/>                                                                                                              | [Gerrit review requests](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/code-hosting.md#code-hosting-gerrit)                                           |
| `google`                                | [google-cloud-storage](https://pypi.org/project/google-cloud-storage/)<br/><br/><br/>[google-cloud-translate](https://pypi.org/project/google-cloud-translate/)<br/><br/> | [Tradução avançada do Google Cloud](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/machine.md#mt-google-translate-api-v3) com suporte a glossário |
| `google-errors`                         | [google-cloud-error-reporting](https://pypi.org/project/google-cloud-error-reporting/)<br/><br/>                                                                          | [Coletando relatórios de erros e monitoramento do desempenho](#collecting-errors)                          |
| `ldap`                                  | [django-auth-ldap](https://pypi.org/project/django-auth-ldap/)<br/><br/>                                                                                                  | [Autenticação por LDAP](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/auth.md#ldap-auth)                                                      |
| `mercurial`                             | [mercurial](https://pypi.org/project/mercurial/)<br/><br/>                                                                                                                | [Mercurial](https://docs.weblate.org/pt-br/weblate-2026.11.1/vcs.md#vcs-mercurial)                                                              |
| `oidc`                                  | [django-oauth-toolkit](https://pypi.org/project/django-oauth-toolkit/)<br/><br/>                                                                                          | [OpenID Connect identity provider](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/auth.md#oidc-provider)                                       |
| `postgres`                              | [psycopg](https://pypi.org/project/psycopg/)<br/><br/>                                                                                                                    | PostgreSQL, consulte [Configuração de banco de dados para o Weblate](#database-setup)                   |
| `rollbar`                               | [rollbar](https://pypi.org/project/rollbar/)<br/><br/>                                                                                                                    | [Coletando relatórios de erros e monitoramento do desempenho](#collecting-errors)                          |
| `saml`                                  | [python3-saml](https://pypi.org/project/python3-saml/)<br/><br/><br/>[xmlsec](https://pypi.org/project/xmlsec/)<br/><br/>                                                 | [Autenticação por SAML](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/auth.md#saml-auth)                                                      |
| `sphinx`                                | [Sphinx](https://pypi.org/project/Sphinx/)<br/><br/>                                                                                                                      | Needed for [Atualizar arquivo POT (Sphinx)](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/addons.md#addon-weblate-gettext-sphinx)               |
| `wllegal`                               | [wllegal](https://pypi.org/project/wllegal/)<br/><br/>                                                                                                                    | Integração ao Hosted Weblate                                                                                                        |
| `wsgi`                                  | [granian](https://pypi.org/project/granian/)<br/><br/>                                                                                                                    | WSGI server for Weblate                                                                                                             |
| `zxcvbn`                                | [django-zxcvbn-password-validator](https://pypi.org/project/django-zxcvbn-password-validator/)<br/><br/>                                                                  | [Autenticação por senha](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/auth.md#password-authentication)                                       |

Ao instalar usando pip, você pode especificar diretamente os recursos desejados ao instalar:

```sh
uv pip install "weblate[Postgres,Amazon,SAML]"
```

Ou você pode instalar o Weblate com todos os recursos opcionais:

```sh
uv pip install "weblate[all]"
```

Ou você pode instalar o Weblate sem quaisquer recursos opcionais:

```sh
uv pip install weblate
```

<a id="troubleshoot-pip-install"></a>

### Solução de problemas via instalação pip

`ffi_prep_closure(): bad user_data (it seems that the version of the libffi library seen at runtime is different from the 'ffi.h' file seen at compile-time)`
: Isso é causado pela incompatibilidade de pacotes binários distribuídos via PyPI com a distribuição. Para resolver isso, você precisa reconstruir o pacote em seu sistema:
  <br/>
  ```sh
  uv pip install --force-reinstall --no-binary :all: cffi
  ```

`error: ‘xmlSecKeyDataFormatEngine’ undeclared (first use in this function); did you mean ‘xmlSecKeyDataFormat’?`
: Este é um problema conhecido do pacote xmlsec. Veja [https://github.com/xmlsec/python-xmlsec/issues/314](https://github.com/xmlsec/python-xmlsec/issues/314).

`lxml & xmlsec libxml2 library version mismatch`
: Os pacotes `lxml` e `xmlsec` precisam ser compilados com base em uma `libxml2`. Você deve compilá-los localmente para evitar este problema:
  <br/>
  ```sh
  uv pip install --force-reinstall --no-binary xmlsec --no-binary lxml lxml xmlsec
  ```

### Outros requisitos do sistema

As seguintes dependências devem ser instaladas no sistema:

`Git`
: [https://git-scm.com/](https://git-scm.com/)

`git-review` (opcional para suporte a Gerrit)
: [git-review](https://pypi.org/project/git-review/)

`git-svn` (opcional para suporte a Subversion)
: [https://git-scm.com/docs/git-svn](https://git-scm.com/docs/git-svn)

`tesseract` (necessário apenas se o programa **tesserocr** não estiverem disponíveis para o seu sistema)
: [https://github.com/tesseract-ocr/tesseract](https://github.com/tesseract-ocr/tesseract)

### Dependências de tempo de compilação

To build some of the [Dependências Python](#python-deps) you might need to install their
dependencies. This depends on how you install them, so please consult
individual packages for documentation. You won’t need those if using prebuilt
`Wheels` while installing using `pip` or when you use distribution packages.

<a id="hardware"></a>

## Requisitos de hardware

O Weblate deve funcionar em qualquer hardware contemporâneo sem problemas. A seguir está a configuração mínima necessária para executar o Weblate em um único host (Weblate, banco de dados e servidor web):

* 3 GB de RAM
* 2 núcleos de CPU
* 1 GB de espaço de armazenamento

#### NOTE
Os requisitos reais para a sua instalação do Weblate variam fortemente com base no tamanho das traduções gerenciadas nele.

### Memória utilizada

Quanto mais memória, melhor - ela é usada para armazenamento em cache em todos os níveis (sistema de arquivos, banco de dados e Weblate). Para centenas de componentes de tradução, recomenda-se pelo menos 4 GB de RAM.

#### HINT
Para sistemas com menos memória do que o recomendado, [Configuração do Celery de processo único](#minimal-celery) é recomendado.

### Uso da CPU

Muitos usuários simultâneos aumentam a quantidade de núcleos de CPU necessários.

Weblate 2026.8 introduced NumPy as a required dependency. On x86-64 systems,
the optimized NumPy build bundled in the Docker image requires an x86-64-v2
compatible CPU. Without the required CPU features, NumPy fails to load and
Weblate cannot start.

Before upgrading, check for the required SSE4.2 CPU feature on the Linux system
running Docker:

```sh
grep sse4_2 /proc/cpuinfo
```

Empty output indicates that a required CPU feature is unavailable. This is a
preliminary check; finding SSE4.2 does not verify all x86-64-v2 CPU features.

If Docker runs in a virtual machine, run the check inside the guest. Virtual
machines can hide CPU features supported by the host. Configure the virtual
machine to expose the required host CPU features, then reboot the guest. If
the physical CPU lacks the required features, upgrade the hardware.

### Uso de armazenamento

O uso típico de armazenamento de banco de dados é de cerca de 300 MB por 1 milhão de palavras hospedadas.

O espaço de armazenamento necessário para repositórios clonados varia, mas o Weblate tenta manter seu tamanho mínimo fazendo clones rasos.

### Storage performance

Version control operations perform many filesystem metadata lookups. The
`vcs` subdirectory in [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR) therefore needs low read
latency; storage with slow metadata access can make operations such as
**git status** take a long time even when its bulk throughput is good.
Keep [`CACHE_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CACHE_DIR) on low-latency local or temporary storage when
possible.

The deployment checks measure metadata lookup latency for both locations and
warn when the median latency exceeds 10 milliseconds. This is an approximate
point-in-time measurement affected by filesystem and system load. Rerun
**weblate check --deploy** before changing the storage configuration.

### Nodes

Para sites de pequeno e médio porte (milhões de palavras hospedadas), todos os componentes do Weblate (consulte [Visão geral da arquitetura](#architecture)) podem ser executados em um único nó.

Quando você atingir centenas de milhões de palavras hospedadas, é recomendável ter um nó dedicado para o banco de dados (consulte [Configuração de banco de dados para o Weblate](#database-setup)).

## Verifying release artifacts

Release archives can be verified using the signatures, attestations, and SBOMs
published with GitHub release assets. See [Verifying release artifacts](https://docs.weblate.org/pt-br/weblate-2026.11.1/security/release-artifacts.md#verify).

<a id="file-permissions"></a>

## Permissões do sistema de arquivos

O processo Weblate precisa ser capaz de ler e escrever para o diretório onde mantém os dados – [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR). Todos os arquivos dentro deste diretório devem ser de propriedade e graváveis pelo usuário que executa todos os processos do Weblate (geralmente WSGI e Celery, consulte [Executando servidor](#server) e [Tarefas de fundo usando Celery](#celery)).

A configuração padrão coloca-os na mesma árvore que os fontes do Weblate, no entanto, você pode preferir movê-los para um local melhor, como `/var/lib/weblate`.

O Weblate tenta criar esses diretórios automaticamente, mas ele falhará quando não tiver permissões para fazê-lo.

The configured [`CACHE_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CACHE_DIR) also has to be writable by the Weblate
process and has to allow executing generated helper files. Do not mount
[`CACHE_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CACHE_DIR) with the `noexec` option.

Você também deve tomar cuidado ao executar [Comandos de gerência](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#manage), pois eles devem ser executados sob o mesmo usuário que o Weblate em si está sendo executado, caso contrário, permissões em alguns arquivos podem estar erradas.

No contêiner Docker, todos os arquivos no volume `/app/data` tem de ter como dono o usuário `weblate` dentro do contêiner (UID 1000).

#### SEE ALSO
[Servindo arquivos estáticos](#static-files)

<a id="database-setup"></a>

## Configuração de banco de dados para o Weblate

Recomenda-se executar o Weblate com um servidor de banco de dados PostgreSQL.

O PostgreSQL 13 e versões superiores são suportados. O PostgreSQL 15 ou mais recente é recomendado.

#### SEE ALSO
* [Usar um poderoso mecanismo de banco de dados](#production-database)
* [Banco de Dados](https://docs.djangoproject.com/pt-br/stable/ref/databases/)
* [Migrando de outros bancos de dados para o PostgreSQL](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/upgrade.md#database-migration)

<a id="db-connections"></a>

### Conexões de banco de dados

Na configuração padrão, cada processo do Weblate mantém uma conexão persistente com o banco de dados. As conexões persistentes melhoram a capacidade de resposta do Weblate, mas podem exigir mais recursos do servidor do banco de dados. Consulte [`CONN_MAX_AGE`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-CONN_MAX_AGE) e [Conexões persistentes](https://docs.djangoproject.com/pt-br/stable/ref/databases/#persistent-database-connections) para obter mais informações.

O Weblate precisa de pelo menos o seguinte número de conexões:

* $(4 \times \mathit{nCPUs}) + 2$ para processos Celery
* $\mathit{nCPUs} + 1$ para trabalhadores WSGI

Isso se aplica aos padrões dos contêineres do Docker e às configurações de exemplo fornecidas nesta documentação, mas os números serão alterados quando você personalizar a quantidade de workers WSGI ou ajustar o paralelismo do Celery.

The actual limit for the number of database connections needs to be higher to
account for the following situations:

* [Comandos de gerência](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#manage) também precisa de sua conexão.
* If a process is killed (for example by OOM killer), it might block the existing connection until timeout.

#### SEE ALSO
[Tarefas de fundo usando Celery](#celery),
[Amostra de configuração para NGINX e uWSGI](#uwsgi),
[`WEBLATE_WORKERS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_WORKERS)

<a id="postgresql"></a>

### PostgreSQL

PostgreSQL é geralmente a melhor escolha para sites baseados em Django. É o banco de dados de referência usado para implementar a camada de banco de dados Django.

#### NOTE
O Weblate usa um complemento de trigrama que deve ser instalado separadamente em alguns casos. Procure por `postgresql-contrib` ou um pacote com nome similar.

#### SEE ALSO
[PostgreSQL notas](https://docs.djangoproject.com/pt-br/stable/ref/databases/#postgresql-notes)

<a id="dbsetup-postgres"></a>

#### Criando um banco de dados no PostgreSQL

Geralmente é uma boa ideia executar o Weblate em um banco de dados separado e separar a conta do usuário:

```sh
# If PostgreSQL was not installed before, set the main password
sudo -u postgres psql postgres -c "\password postgres"

# Create a database user called "weblate"
sudo -u postgres createuser --superuser --pwprompt weblate

# Create the database "weblate" owned by "weblate"
sudo -u postgres createdb -E UTF8 -O weblate weblate
```

#### HINT
Se você não quiser fazer do usuário do Weblate um superusuário no PostgreSQL, você pode omitir isso. Nesse caso, você terá que executar algumas das etapas de migração manualmente como um superusuário PostgreSQL no esquema Weblate usará:

```postgres
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS btree_gin;
CREATE EXTENSION IF NOT EXISTS btree_gist;
```

<a id="config-postgresql"></a>

#### Configurando Weblate para usar PostgreSQL

O trecho de `settings.py` para PostgreSQL:

```python
DATABASES = {
    "default": {
        # Database engine
        "ENGINE": "django.db.backends.postgresql",
        # Database name
        "NAME": "weblate",
        # Database user
        "USER": "weblate",
        # Configures name of the PostgreSQL role to alter during the database migration
        # "ALTER_ROLE": "weblate",
        # Database password
        "PASSWORD": "password",
        # Set to empty string for localhost
        "HOST": "database.example.com",
        # Set to empty string for default
        "PORT": "",
        # Persistent connections
        "CONN_MAX_AGE": None,
        "CONN_HEALTH_CHECKS": True,
    }
}
```

A migração do banco de dados executa [ALTER ROLE](https://www.postgresql.org/docs/16/sql-alterrole.html) na função de banco de dados usada pelo Weblate. Na maioria dos casos, o nome da função corresponde ao nome de usuário. Em configurações mais complexas, o nome da função é diferente do nome de usuário e você obterá um erro sobre a função não existente durante a migração do banco de dados (`psycopg2.errors.UndefinedObject: role "weblate@hostname" does not exist`). Isso é conhecido por acontecer com o Azure Database para PostgreSQL, mas não está limitado a este ambiente. Defina `ALTER_ROLE` para alterar o nome da função que o Weblate deve alterar durante a migração do banco de dados.

#### SEE ALSO
[Conexões de banco de dados](#db-connections)

## Outras configurações

<a id="out-mail"></a>

### Configuração de e-mail de saída

O Weblate envia e-mails em várias ocasiões - para ativação de conta e sobre várias notificações configuradas pelos usuários. Para isso, ele precisa de acesso a um servidor SMTP.

A configuração do servidor de e-mail é configurada usando essas configurações: [`EMAIL_HOST`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_HOST), [`EMAIL_HOST_PASSWORD`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_HOST_PASSWORD), [`EMAIL_USE_SSL`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_USE_SSL), [`EMAIL_USE_TLS`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_USE_TLS), [`EMAIL_HOST_USER`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_HOST_USER) e [`EMAIL_PORT`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_PORT). Seus nomes são bastante autoexplicativos, mas você pode encontrar mais informações na documentação do Django.

#### HINT
Caso você receba um erro sobre autenticação não suportada (por exemplo, `SMTP AUTH extension not supported by server`), isso provavelmente é causado pelo uso de uma conexão insegura e o servidor se recusa a autenticar dessa forma. Tente ativar a [`EMAIL_USE_TLS`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_USE_TLS) nesse caso.

#### SEE ALSO
* [Não recebendo e-mails do Weblate](https://docs.weblate.org/pt-br/weblate-2026.11.1/contributing/debugging.md#debug-mails)
* [Configuring outgoing e-mail in Docker container](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#docker-mail)

<a id="reverse-proxy"></a>

### Executando por trás de um proxy reverso

Várias funcionalidades do Weblate dependem da transmissão correta de cabeçalhos HTTP. Ao usar proxy reverso, certifique-se de que as informações necessárias sejam transmitidas corretamente.

To debug this configuration, you can look at HTTP environment in
[Relatório de desempenho](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/admin.md#manage-performance).

Endereço IP do cliente
: This is needed for [Limitação de taxa](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/optionals.md#rate-limit) or [Atividade](https://docs.weblate.org/pt-br/weblate-2026.11.1/user/profile.md#audit-log).
  <br/>
  O Weblate analisa o endereço IP do `REMOTE_ADDR`, que é definido pelo manipulador WSGI. Ele pode estar vazio (ao usar socket para WSGI) ou conter um endereço de proxy reverso, então o Weblate precisa de um cabeçalho HTTP adicional com um endereço IP do cliente.
  <br/>
  Habilitar [`IP_BEHIND_REVERSE_PROXY`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_BEHIND_REVERSE_PROXY) deve ser suficiente para as configurações mais comuns, mas talvez você precise ajustar [`IP_PROXY_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_PROXY_HEADER) e [`IP_PROXY_OFFSET`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_PROXY_OFFSET) também (use [`WEBLATE_IP_PROXY_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_HEADER) e [`WEBLATE_IP_PROXY_OFFSET`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_OFFSET) no contêiner do Docker).
  <br/>
  The reverse proxy which connects to Weblate must overwrite the configured
  header or append a verified peer address at the position selected by
  [`IP_PROXY_OFFSET`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_PROXY_OFFSET). Do not select a client-supplied address, and do
  not expose the application server through a path which bypasses the trusted
  proxy.
  <br/>
  When using `X-Forwarded-For` with the Docker container, configure
  [`WEBLATE_TRUSTED_PROXY_ADDRESSES`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_TRUSTED_PROXY_ADDRESSES) with the reverse proxies allowed
  to supply client addresses.
  <br/>
  #### HINT
  Esta configuração não pode ser ativada por padrão, pois isso permitiria a falsificação de endereço IP em instalações que não têm um proxy reverso configurado corretamente.

Nome do host do servidor
: O cabeçalho [Host](https://www.rfc-editor.org/info/rfc7230#section-5.4) deve corresponder ao que está configurado como [`SITE_DOMAIN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SITE_DOMAIN). Configuração adicional pode ser necessária em seu proxy reverso (por exemplo, use `ProxyPreserveHost On` para Apache ou `proxy_set_header Host $host;` com nginx).
  <br/>
  #### HINT
  CSRF verification failed errors are often caused by a mismatch between
  the [Host](https://www.rfc-editor.org/info/rfc7230#section-5.4) header and configured [`SITE_DOMAIN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SITE_DOMAIN).

Protocolo do cliente
: Não passar o protocolo correto pode fazer com que o Weblate acabe em um loop de redirecionamento ao tentar atualizar o cliente para HTTPS. Certifique-se de que ele seja exposto corretamente pelo proxy reverso como *X-Forwarded-Proto*.
  <br/>
  This header then needs to be configured in
  [`SECURE_PROXY_SSL_HEADER`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SECURE_PROXY_SSL_HEADER) (`settings.py`) or
  [`WEBLATE_SECURE_PROXY_SSL_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_SECURE_PROXY_SSL_HEADER) (Docker environment).
  <br/>
  #### IMPORTANT
  The header value is case-sensitive in the configuration, so
  `WEBLATE_SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https` and
  `WEBLATE_SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,HTTPS` are not
  interchangeable.
  <br/>
  #### HINT
  If you are getting a “Too many redirects” error from the browser, this is
  most likely caused by mismatch between the actual protocol (HTTPS) and
  what is observed by Weblate.
  <br/>
  #### Versionchanged
  Alterado na versão 5.13: The protocol proxy headers are automatically handled by
  **gunicorn** in the default configuration, but other WSGI servers
  have more secure configuration and require explicit setting of this.
  <br/>
  Since Weblate 5.13 the Docker container is using **granian** and
  it now requires the explicit configuration of
  [`WEBLATE_SECURE_PROXY_SSL_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_SECURE_PROXY_SSL_HEADER).

#### SEE ALSO
* [SSL terminating proxy](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#docker-ssl-proxy)
* [Limitação de taxa](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/optionals.md#rate-limit)
* [Atividade](https://docs.weblate.org/pt-br/weblate-2026.11.1/user/profile.md#audit-log)
* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Amostra de configuração para NGINX e Gunicorn](#nginx-gunicorn)
* [Amostra de configuração para NGINX e uWSGI](#uwsgi)
* [Amostra de configuração para o Apache](#apache)
* [Amostra de configuração para Apache e Gunicorn](#apache-gunicorn)
* [`IP_BEHIND_REVERSE_PROXY`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_BEHIND_REVERSE_PROXY)
* [`IP_PROXY_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_PROXY_HEADER)
* [`IP_PROXY_OFFSET`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-IP_PROXY_OFFSET)
* [`SECURE_PROXY_SSL_HEADER`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SECURE_PROXY_SSL_HEADER)
* [`WEBLATE_IP_PROXY_HEADER`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_HEADER)
* [`WEBLATE_TRUSTED_PROXY_ADDRESSES`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_TRUSTED_PROXY_ADDRESSES)
* [`WEBLATE_IP_PROXY_OFFSET`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_OFFSET)

<a id="http-proxy"></a>

### Proxy HTTP

Weblate supports per-protocol HTTP proxy configuration for outbound HTTP
requests and Git repositories. Define the proxy environment variables in
`settings.py`:

```python
import os

os.environ["http_proxy"] = "http://proxy.example.com:8080"
os.environ["https_proxy"] = "http://proxy.example.com:8080"
```

Only `http_proxy` and `https_proxy` are supported. Generic and bypass
variables such as `all_proxy` and `no_proxy`, operating-system proxy
configuration, and VCS-specific proxy configuration are not supported.

#### SEE ALSO
[Proxy environment variables](https://everything.curl.dev/usingcurl/proxies/env.html)

<a id="configuration"></a>

## Ajustando a configuração

#### SEE ALSO
[Amostra de configuração](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/sample.md#sample-configuration)

Copie `weblate/settings_example.py` para `weblate/settings.py` e ajuste-o para corresponder à configuração. Você provavelmente vai querer ajustar as seguintes opções:

<a id="std-setting-ADMINS"></a>

`ADMINS`

> Lista de administradores de sites para receber notificações quando algo dá errado, por exemplo, notificações em mesclagens fracassadas ou erros de Django.

> O formulário de contato também envia e-mail para eles, a menos que a [`ADMINS_CONTACT`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ADMINS_CONTACT) esteja configurada.

> #### SEE ALSO
> * [`ADMINS`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-ADMINS)
> * [`ADMINS_CONTACT`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ADMINS_CONTACT)
> * [Configurar corretamente administradores](#production-admins)

<a id="std-setting-ALLOWED_HOSTS"></a>

`ALLOWED_HOSTS`

> Você precisa definir isso para listar os hosts que seu site deve servir. Por exemplo:

> ```python
> ALLOWED_HOSTS = ["demo.weblate.org"]
> ```

> Alternativamente, você pode incluir curinga:

> ```python
> ALLOWED_HOSTS = ["*"]
> ```

> #### SEE ALSO
> * [`ALLOWED_HOSTS`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-ALLOWED_HOSTS)
> * [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS)
> * [Configuração de hosts permitidos](#production-hosts)

<a id="std-setting-SESSION_ENGINE"></a>

`SESSION_ENGINE`

> Configure como suas sessões serão armazenadas. Caso você mantenha o mecanismo de backend do banco de dados padrão, você deve agendar: **weblate clearsessions** para remover dados de sessão obsoletos do banco de dados.

> If you are using Valkey or Redis as cache (see [Configure cache](#production-cache)) it is
> recommended to use it for sessions as well:

> ```python
> SESSION_ENGINE = "django.contrib.sessions.backends.cache"
> ```

> #### SEE ALSO
> * [Configuring the session engine](https://docs.djangoproject.com/pt-br/stable/topics/http/sessions/#configuring-sessions)
> * [`SESSION_ENGINE`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SESSION_ENGINE)

<a id="std-setting-DATABASES"></a>

`DATABASES`

> Conectividade ao servidor de banco de dados, verifique a documentação do Django para obter mais detalhes.

> #### SEE ALSO
> * [Configuração de banco de dados para o Weblate](#database-setup)
> * [`DATABASES`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-DATABASES)
> * [Banco de Dados](https://docs.djangoproject.com/pt-br/stable/ref/databases/)

<a id="std-setting-DEBUG"></a>

`DEBUG`

> Desabilite isso para qualquer servidor de produção. Com o modo depuração ativado, o Django mostrará backtraces em caso de erro aos usuários, quando você desabilitá-lo, erros serão enviados por e-mail para `ADMINS` (veja acima).

> O modo depuração também diminui o Weblate, já que o Django armazena muito mais informações internamente neste caso.

> #### SEE ALSO
> * [`DEBUG`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-DEBUG)
> * [Desabilitar o modo de depuração](#production-debug)

<a id="std-setting-DEFAULT_FROM_EMAIL"></a>

`DEFAULT_FROM_EMAIL`

> Endereço de remetente de e-mail para e-mail de saída, por exemplo, e-mails de registro.

> #### SEE ALSO
> [`DEFAULT_FROM_EMAIL`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-DEFAULT_FROM_EMAIL)

<a id="std-setting-SECRET_KEY"></a>

`SECRET_KEY`

> Chave usada por Django para assinar algumas informações em cookies, consulte [Chave secreta do Django](#production-secret) para obter mais informações.

> #### SEE ALSO
> [`SECRET_KEY`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SECRET_KEY)

<a id="std-setting-SERVER_EMAIL"></a>

`SERVER_EMAIL`

> E-mail usado como endereço de remetente para envio de e-mails ao administrador, por exemplo, notificações em mesclagens fracassadas.

> #### SEE ALSO
> [`SERVER_EMAIL`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SERVER_EMAIL)

<a id="tables-setup"></a>

## Preenchendo o banco de dados

Depois que sua configuração estiver pronta, você pode executar [`migrate`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-migrate) para criar a estrutura do banco de dados. Agora você deve ser capaz de criar projetos de tradução usando a interface administrativa.

Uma vez feito, você também deve verificar o Relatório de desempenho na interface administrativa, o que lhe dará dicas de configuração potencial não ideal em seu site.

#### SEE ALSO
* [Configuração](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#config)
* [Lista de privilégios](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/access.md#privileges)

<a id="production"></a>

## Configuração de produção

Para uma configuração de produção, você deve realizar ajustes descritos nas seções a seguir. As configurações mais críticas acionarão um aviso, que é indicado por um ponto de exclamação na barra superior se conectado como um superusuário:

![image](screenshots/admin-wrench.webp)

Também é recomendado inspecionar verificações desencadeadas por Django (embora você possa não precisar corrigir todas elas):

```sh
weblate check --deploy
```

Você também pode revisar a mesma lista de verificação em [Relatório de desempenho](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/admin.md#manage-performance) na [Interface de gerenciamento](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/admin.md#management-interface).

#### SEE ALSO
[Lista de verificação para distribuição](https://docs.djangoproject.com/pt-br/stable/howto/deployment/checklist/)

<a id="production-debug"></a>

### Desabilitar o modo de depuração

Desabilite o modo de depuração do Django ([`DEBUG`](#std-setting-DEBUG)) com:

```python
DEBUG = False
```

Com o modo depuração ativado, o Django armazena todas as consultas executadas e mostra aos usuários atrasos de erros, o que não é desejado em uma configuração de produção.

#### SEE ALSO
[Ajustando a configuração](#configuration)

<a id="production-admins"></a>

### Configurar corretamente administradores

Set the correct admin addresses to the [`ADMINS`](#std-setting-ADMINS) setting to define who will receive
e-mails in case something goes wrong on the server, for example:

```python
ADMINS = ("Your Name <your_email@example.com>",)
```

#### SEE ALSO
[Ajustando a configuração](#configuration)

<a id="production-site"></a>

### Definir domínio correto do site

Ajuste o nome e o domínio do site na interface administrativa, caso contrário, links no RSS ou e-mails de registro não funcionarão. Isso é configurado usando [`SITE_DOMAIN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SITE_DOMAIN) que deve conter o nome de domínio do site.

#### Versionchanged
Alterado na versão 4.2: Antes da versão 4.2, a estrutura de sites do Django era usada em vez disso, consulte [The “sites” framework](https://docs.djangoproject.com/pt-br/stable/ref/contrib/sites/).

#### SEE ALSO
* [Configuração de hosts permitidos](#production-hosts)
* [Configurar corretamente HTTPS](#production-ssl)
* [`SITE_DOMAIN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SITE_DOMAIN)
* [`WEBLATE_SITE_DOMAIN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_SITE_DOMAIN)
* [`ENABLE_HTTPS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ENABLE_HTTPS)

<a id="production-ssl"></a>

### Configurar corretamente HTTPS

É fortemente recomendado executar Weblate usando o protocolo HTTPS criptografado. Depois de habilitá-lo, você deve definir [`ENABLE_HTTPS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ENABLE_HTTPS) nas configurações:

```python
ENABLE_HTTPS = True
```

#### HINT
Você pode querer configurar o HSTS também, consulte [SSL/HTTPS](https://docs.djangoproject.com/pt-br/stable/topics/security/#security-recommendation-ssl) para obter mais detalhes.

#### SEE ALSO
* [`ENABLE_HTTPS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ENABLE_HTTPS)
* [Configuração de hosts permitidos](#production-hosts)
* [Definir domínio correto do site](#production-site)

### Definir corretamente SECURE_HSTS_SECONDS

Se o seu site for servido sobre SSL, você deve considerar definir um valor para [`SECURE_HSTS_SECONDS`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SECURE_HSTS_SECONDS) no `settings.py` para habilitar HTTP Strict Transport Security. Por padrão, ele está definido para 0 como mostrado abaixo.

```python
SECURE_HSTS_SECONDS = 0
```

Se definido como um valor inteiro não-zero, o cabeçalho [`django.middleware.security.SecurityMiddleware`](https://docs.djangoproject.com/pt-br/stable/ref/middleware/#django.middleware.security.SecurityMiddleware) define o cabeçalho [HTTP Strict Transport Security](https://docs.djangoproject.com/pt-br/stable/ref/middleware/#http-strict-transport-security) em todas as respostas que ainda não o possuem.

#### WARNING
Definir isso incorretamente pode quebrar irreversivelmente (por algum tempo) seu site. Leia primeiro a documentação [HTTP Strict Transport Security](https://docs.djangoproject.com/pt-br/stable/ref/middleware/#http-strict-transport-security).

<a id="production-database"></a>

### Usar um poderoso mecanismo de banco de dados

* Por favor, use PostgreSQL para um ambiente de produção, consulte [Configuração de banco de dados para o Weblate](#database-setup) para obter mais informações.
* Use um local adjacente para executar o servidor de banco de dados, caso contrário, o desempenho ou confiabilidade da rede podem arruinar sua experiência com o Weblate.
* Verifique o desempenho do servidor de banco de dados ou ajuste sua configuração, por exemplo, usando [PGTune](https://pgtune.leopard.in.ua/).
* Weblate deployment checks report non-finite PostgreSQL relation statistics.
  Run `ANALYZE` on the reported relations to rebuild corrupted statistics.

#### SEE ALSO
* [Configuração de banco de dados para o Weblate](#database-setup)
* [Migrando de outros bancos de dados para o PostgreSQL](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/upgrade.md#database-migration)
* [Ajustando a configuração](#configuration)
* [Banco de Dados](https://docs.djangoproject.com/pt-br/stable/ref/databases/)

<a id="production-cache"></a>

### Configure cache

If possible, use Valkey or Redis from Django by adjusting the `CACHES`
configuration variable, for example:

```python
CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/0",
        # If redis is running on same host as Weblate, you might
        # want to use unix sockets instead:
        # 'LOCATION': 'unix:///var/run/redis/redis.sock?db=0',
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            "PARSER_CLASS": "redis.connection.HiredisParser",
        },
    }
}
```

#### HINT
In case you change settings for the cache, you might need to adjust them for
Celery as well, see [Tarefas de fundo usando Celery](#celery).

#### SEE ALSO
* [Cache de avatares](#production-cache-avatar)
* [O framework de “cache” do Django](https://docs.djangoproject.com/pt-br/stable/topics/cache/)

<a id="production-cache-avatar"></a>

### Cache de avatares

Além do cache de Django, Weblate realiza cache de avatares. Recomenda-se usar um cache separado, baseado em arquivos para este fim:

```python
CACHES = {
    "default": {
        # Default caching backend setup, see above
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "unix:///var/run/redis/redis.sock?db=0",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            "PARSER_CLASS": "redis.connection.HiredisParser",
        },
    },
    "avatar": {
        "BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
        "LOCATION": os.path.join(DATA_DIR, "avatar-cache"),
        "TIMEOUT": 604800,
        "OPTIONS": {
            "MAX_ENTRIES": 1000,
        },
    },
}
```

#### SEE ALSO
* [`ENABLE_AVATARS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-ENABLE_AVATARS)
* [`AVATAR_URL_PREFIX`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-AVATAR_URL_PREFIX)
* [Avatares](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/optionals.md#avatars)
* [Configure cache](#production-cache)
* [O framework de “cache” do Django](https://docs.djangoproject.com/pt-br/stable/topics/cache/)

<a id="production-email"></a>

### Configurar envio de e-mail

O Weblate precisa enviar e-mails em várias ocasiões, e esses e-mails devem ter um endereço de remetente correto, por favor, configure [`SERVER_EMAIL`](#std-setting-SERVER_EMAIL) e [`DEFAULT_FROM_EMAIL`](#std-setting-DEFAULT_FROM_EMAIL) para combinar com o seu ambiente, por exemplo:

```python
SERVER_EMAIL = "admin@example.org"
DEFAULT_FROM_EMAIL = "weblate@example.org"
```

#### NOTE
Para desabilitar o envio de e-mails pelo Weblate, defina [`EMAIL_BACKEND`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_BACKEND) para `django.core.mail.backends.dummy.EmailBackend`.

Isso desabilitará *toda* entrega de e-mail, incluindo e-mails de registro ou redefinição de senha.

#### SEE ALSO
* [Ajustando a configuração](#configuration)
* [Configuração de e-mail de saída](#out-mail)
* [`EMAIL_BACKEND`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-EMAIL_BACKEND)
* [`DEFAULT_FROM_EMAIL`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-DEFAULT_FROM_EMAIL)
* [`SERVER_EMAIL`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-SERVER_EMAIL)

<a id="production-hosts"></a>

### Configuração de hosts permitidos

Django requer [`ALLOWED_HOSTS`](#std-setting-ALLOWED_HOSTS) para manter uma lista de nomes de domínio que seu site pode servir, deixando-o vazio bloqueará quaisquer solicitações.

Caso isso não esteja configurado para corresponder ao seu servidor HTTP, você terá erros como `Invalid HTTP_HOST header: '1.1.1.1'. You may need to add '1.1.1.1' to ALLOWED_HOSTS.`

#### HINT
No contêiner Docker, isso está disponível como [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS).

#### SEE ALSO
* [`ALLOWED_HOSTS`](#std-setting-ALLOWED_HOSTS)
* [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS)
* [Definir domínio correto do site](#production-site)

<a id="production-secret"></a>

### Chave secreta do Django

A configuração [`SECRET_KEY`](#std-setting-SECRET_KEY) é usada pelo Django para assinar cookies, e você deve realmente gerar seu próprio valor em vez de usar o da configuração do exemplo.

Você pode gerar uma nova chave usando **weblate-generate-secret-key**, que vem com o Weblate.

#### SEE ALSO
[`SECRET_KEY`](#std-setting-SECRET_KEY)

<a id="production-cron"></a>

### Executando tarefas de manutenção

Para um desempenho ideal, é uma boa ideia executar algumas tarefas de manutenção em segundo plano. Isso é feito automaticamente por [Tarefas de fundo usando Celery](#celery) e cobre as seguintes tarefas:

* Verificação de saúde da configuração (de hora em hora).
* Realização de commits de alterações pendentes (de hora em hora), consulte [Commits adiados](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/continuous.md#lazy-commit) e [`commit_pending`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-commit_pending).
* Atualização de alertas de componentes (diariamente).
* Update remote branches (nightly), see [`AUTO_UPDATE`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-AUTO_UPDATE).
* Backup de memória de tradução para JSON (diariamente), consulte [`dump_memory`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-dump_memory).
* Tarefas de manutenção de texto completo e banco de dados (tarefas diárias e semanais), consulte [`cleanuptrans`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-cleanuptrans).

<a id="production-encoding"></a>

### Codificação e localidades do sistema

As localidades do sistema devem ser configuradas para UTF-8. Na maioria das distribuições Linux, esta é a configuração padrão. Caso não seja o caso em seu sistema, altere as localidades para a variante UTF-8.

Por exemplo, editando `/etc/default/locale` e definindo lá `LANG="C.UTF-8"`.

Em alguns casos, os serviços individuais têm configuração separada para locais. Isso varia entre a distribuição e os servidores da web, portanto, verifique a documentação dos pacotes do servidor da web para isso.

Apache no Ubuntu usa `/etc/apache2/envvars`:

```sh
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
```

Apache no CentOS usa `/etc/sysconfig/httpd` (ou `/opt/rh/httpd24/root/etc/sysconfig/httpd`):

```sh
LANG='en_US.UTF-8'
```

<a id="production-certs"></a>

### Usando autoridade certificadora personalizada

Weblate verifies SSL certificates during HTTP requests. Requests made using
HTTPX2 use the system certificate store, so install custom certificate
authorities there.

Check your distribution documentation for more details. For example, on Debian
this can be done by placing the CA certificate into
`/usr/local/share/ca-certificates/` and running
**update-ca-certificates**.

#### HINT
O contêiner do Weblate não o inclui no caminho de busca; é necessário especificar o caminho completo para executá-lo. Por exemplo:

```sh
docker compose exec -u root weblate /usr/sbin/update-ca-certificates
```

Once this is done, Weblate HTTPX2 requests and system tools, including Git, will
trust the certificate.

Some integrations, including OAuth and OpenID Connect authentication, use
Requests, which does not use the system certificate store by default. When
these integrations communicate with services using the custom certificate
authority, configure Requests to use the system CA bundle by adding the
following to `settings.py` (the path is Debian-specific):

```python
import os

os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
```

<a id="server"></a>

## Executando servidor

#### HINT
No caso de você não ter experiência com os serviços descritos abaixo, você pode tentar seguir [Instalando usando Docker](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md).

Você precisará de vários serviços para executar o Weblate, a configuração recomendada consiste em:

* Servidor de banco de dados (consulte [Configuração de banco de dados para o Weblate](#database-setup))
* Servidor de cache (consulte [Configure cache](#production-cache))
* Servidor web frontend para arquivos estáticos e terminação SSL (consulte [Servindo arquivos estáticos](#static-files))
* Servidor WSGI para conteúdo dinâmico (consulte [Amostra de configuração para NGINX e uWSGI](#uwsgi))
* Celery para executar tarefas em segundo plano (consulte [Tarefas de fundo usando Celery](#celery))

#### NOTE
Existem algumas dependências entre os serviços, por exemplo, o cache e o banco de dados devem estar em execução ao iniciar os processos de Celery ou uwsgi.

Na maioria dos casos, você executará todos os serviços em um único servidor (virtual), mas no caso de sua instalação estar muito carregada, você pode dividir os serviços. A única limitação disso é que os servidores Celery e Wsgi precisam acessar [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR).

#### NOTE
O processo de WSGI deve ser executado sob o mesmo usuário que o processo do Celery, caso contrário, os arquivos em [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR) serão armazenados com propriedade mista, levando a problemas de tempo de execução.

Consulte também [Permissões do sistema de arquivos](#file-permissions) e [Tarefas de fundo usando Celery](#celery).

### Executando servidor web

Executar o Weblate não é diferente de executar qualquer outro programa baseado em Django. Django é geralmente executado como WSGI ou fcgi (consulte exemplos para diferentes servidores web abaixo).

#### NOTE
The sample configuration files shown below are maintained in the Weblate
source tree under `weblate/examples/`. They are included in source
distributions and in this documentation, but Python wheels only install
runtime files. When installing Weblate from PyPI, get the matching source
distribution or source checkout before copying these examples.

Para fins de teste, você pode usar o servidor web embutido no Django:

```sh
weblate runserver
```

#### WARNING
NÃO USE ESTE SERVIDOR EM UMA CONFIGURAÇÃO DE PRODUÇÃO. Ele não passou por auditorias de segurança ou testes de desempenho. Consulte também a documentação de Django no [`runserver`](https://docs.djangoproject.com/pt-br/stable/ref/django-admin/#django-admin-runserver).

#### HINT
O servidor integrado do Django serve arquivos estáticos apenas com [`DEBUG`](#std-setting-DEBUG) habilitado, pois se destina apenas ao desenvolvimento. Para uso em produção, consulte as configurações WSGI:

* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Amostra de configuração para NGINX e Gunicorn](#nginx-gunicorn)
* [Amostra de configuração para NGINX e uWSGI](#uwsgi)
* [Amostra de configuração para o Apache](#apache)
* [Amostra de configuração para Apache e Gunicorn](#apache-gunicorn)
* [Servindo arquivos estáticos](#static-files)

<a id="static-files"></a>

### Servindo arquivos estáticos

#### Versionchanged
Alterado na versão 5.15.2: `/media/` is no longer used for serving screenshots.

Django needs to collect its static files in a single directory. To do so,
execute `weblate collectstatic --noinput`. This will copy the static
files into a directory specified by the [`STATIC_ROOT`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-STATIC_ROOT) setting (this defaults to
a `static` directory inside [`CACHE_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CACHE_DIR)). Production installations
use content hashes in collected filenames so that updated assets do not reuse
stale browser or proxy caches.

Recomenda-se servir arquivos estáticos diretamente do seu servidor web. Você deve usá-los para os seguintes caminhos:

`/static/`
: Serve arquivos estáticos para Weblate e a interface de administração (definida por [`STATIC_ROOT`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-STATIC_ROOT)).

`/favicon.ico`
: Should be rewritten to serve `/static/favicon.ico`.

#### SEE ALSO
* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Amostra de configuração para NGINX e Gunicorn](#nginx-gunicorn)
* [Amostra de configuração para NGINX e uWSGI](#uwsgi)
* [Amostra de configuração para o Apache](#apache)
* [Amostra de configuração para Apache e Gunicorn](#apache-gunicorn)
* [How to deploy Django](https://docs.djangoproject.com/pt-br/stable/howto/deployment/)
* [How to deploy static files](https://docs.djangoproject.com/pt-br/stable/howto/static-files/deployment/)

<a id="csp"></a>

### Política da Segurança de Conteúdo

A configuração padrão do Weblate habilita o middleware `weblate.middleware.SecurityMiddleware` que define cabeçalhos HTTP relacionados à segurança como *Content-Security-Policy* ou *X-XSS-Protection*. Eles são configurados por padrão para funcionar com o Weblate e sua configuração, mas isso pode precisar de personalização para o seu ambiente.

#### SEE ALSO
* [`CSP_SCRIPT_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_SCRIPT_SRC)
* [`CSP_IMG_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_IMG_SRC)
* [`CSP_CONNECT_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_CONNECT_SRC)
* [`CSP_STYLE_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_STYLE_SRC)
* [`CSP_FONT_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_FONT_SRC)
* [`CSP_FORM_SRC`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-CSP_FORM_SRC)

<a id="nginx-granian"></a>

### Sample configuration for NGINX and Granian

The following configuration runs Weblate using Granian with the NGINX webserver:

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:8888;
        proxy_read_timeout 3600;
    }
}
```

#### SEE ALSO
* [Sample configuration to start Granian](#running-granian)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [Como implementar com WSGI](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/)

<a id="nginx-gunicorn"></a>

### Amostra de configuração para NGINX e Gunicorn

The following configuration runs Weblate using Gunicorn under the NGINX webserver
(`weblate/examples/weblate.nginx.gunicorn.conf` in the source tree):

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_pass http://unix:/run/gunicorn.sock;
        proxy_read_timeout 3600;
    }
}
```

#### SEE ALSO
* [Amostra de configuração para iniciar Gunicorn](#running-gunicorn)
* [Como usar o Django com o Gunicorn](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/gunicorn/)

<a id="uwsgi"></a>

### Amostra de configuração para NGINX e uWSGI

To run production webserver, use the WSGI wrapper installed with Weblate (when
using a Python environment it is installed as
`~/weblate-env/lib/python3.14/site-packages/weblate/wsgi.py`). Don’t
forget to set the Python search path to your Python environment as well (for
example using `virtualenv = /home/user/weblate-env` in uWSGI).

A configuração a seguir executa o Weblate como uWSGI sob o servidor web NGINX.

Configuration for NGINX (`weblate/examples/weblate.nginx.conf` in the source tree):

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        include uwsgi_params;
        # Needed for long running operations in admin interface
        uwsgi_read_timeout 3600;
        # Adjust based to uwsgi configuration:
        uwsgi_pass unix:///run/uwsgi/app/weblate/socket;
        # uwsgi_pass 127.0.0.1:8080;
    }
}
```

Configuration for uWSGI (`weblate/examples/weblate.uwsgi.ini` in the source tree):

```ini
#
# uWSGI configuration for Weblate
#
# You will want to change:
#
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
[uwsgi]
plugins       = python3
master        = true
protocol      = uwsgi
socket        = 127.0.0.1:8080
wsgi-file     = /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py

# Add path to Weblate checkout if you did not install
# Weblate by pip
# python-path   = /path/to/weblate

# Path to the Python environment
virtualenv = /home/weblate/weblate-env

# Set sys.executable so Python helpers run with the virtual environment's Python
py-executable = /home/weblate/weblate-env/bin/python

# Needed for OAuth/OpenID
buffer-size   = 8192

# Reload when consuming too much of memory
reload-on-rss = 250

# Increase number of workers for heavily loaded sites
workers       = 8

# Enable threads for Sentry error submission
enable-threads = true

# Child processes do not need file descriptors
close-on-exec = true

# Avoid default 0000 umask
umask = 0022

# Run as weblate user
uid = weblate
gid = weblate

# Enable harakiri mode (kill requests after some time)
# harakiri = 3600
# harakiri-verbose = true

# Enable uWSGI stats server
# stats = :1717
# stats-http = true

# Do not log some errors caused by client disconnects
ignore-sigpipe = true
ignore-write-errors = true
disable-write-exception = true
```

Set `py-executable` to the absolute path of `bin/python` inside the
environment configured by `virtualenv`. Weblate uses Python’s
`sys.executable` to launch helper processes, including the SSH connection
proxy used for Git repositories. uWSGI can otherwise set this value to its own
executable, causing repository operations to fail with an error such as
`/usr/bin/uwsgi-core: invalid option -- 'I'`. Setting `virtualenv` alone does
not ensure that `sys.executable` points to Python. Restart uWSGI after updating
the configuration.

#### SEE ALSO
[Como usar Django com uWSGI](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/uwsgi/)

<a id="apache"></a>

### Amostra de configuração para o Apache

Recomenda-se o uso de prefork de MPM ao usar WSGI com Weblate.

The following configuration runs Weblate as WSGI, you need to have enabled
`mod_wsgi` (`weblate/examples/apache.conf` in the source tree):

```apache
#
# VirtualHost for Weblate
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match Python version mod-wsgi is compiled for
# - change weblate user to match your Weblate user
#
<VirtualHost *:80>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    # Path to your Weblate Python environment
    WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate request-timeout=600
    WSGIProcessGroup weblate
    WSGIApplicationGroup %{GLOBAL}

    WSGIScriptAlias / /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py process-group=weblate
    WSGIPassAuthorization On

    <Directory /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/>
        <Files wsgi.py>
        Require all granted
        </Files>
    </Directory>

</VirtualHost>
```

#### NOTE
Weblate precisa do Python 3, então, por favor se certifique que você está executando a variante do Python 3 do modwsgi. Usualmente, está disponível como um pacote separado, por exemplo `libapache2-mod-wsgi-py3`.

Use a versão Python correspondente para instalar o Weblate.

#### SEE ALSO
* [Codificação e localidades do sistema](#production-encoding)
* [Como usar o Django com Apache e mod_wsgi](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/modwsgi/)

<a id="apache-gunicorn"></a>

### Amostra de configuração para Apache e Gunicorn

The following configuration runs Weblate in Gunicorn and Apache 2.4
(`weblate/examples/apache.gunicorn.conf` in the source tree):

```apache
#
# VirtualHost for Weblate using gunicorn on localhost:8000
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change weblate user to match your Weblate user
#
<VirtualHost *:443>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/https_cert.cert
    SSLCertificateKeyFile /etc/apache2/ssl/https_key.pem
    SSLProxyEngine On

    ProxyPass /favicon.ico !
    ProxyPass /static/ !

    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000/
    ProxyPreserveHost On
</VirtualHost>
```

#### SEE ALSO
* [Amostra de configuração para iniciar Gunicorn](#running-gunicorn)
* [Como usar o Django com o Gunicorn](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/gunicorn/)

<a id="running-granian"></a>

### Sample configuration to start Granian

Weblate has wsgi optional dependency (see [Dependências Python](#python-deps)) that will
install everything you need to run Granian. When installing Weblate you can specify it as:

```shell
uv pip install Weblate[all,wsgi]
```

Once you have Granian installed, you can run it. This is usually done at the
system level. The following examples show starting via systemd:

```ini
[Unit]
Description=granian daemon
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
RuntimeDirectory=granian
ExecStart=/home/weblate/weblate-env/bin/granian \
    --no-ws \
    --workers-max-rss 450 \
    --interface wsgi \
    --workers 2 \
    --blocking-threads 8 \
    --backlog 128 \
    --backpressure 16 \
    --runtime-mode mt \
    --port 8888 \
    weblate.wsgi:application

[Install]
WantedBy=multi-user.target
```

Granian uses worker processes for parallel Python execution, blocking threads
for concurrent WSGI requests, and runtime threads for network I/O. The sample
uses two workers with eight blocking threads each, limits each worker to 16
concurrent connections, and leaves the runtime threads at Granian’s default.
Adjust the workers and blocking threads to the available memory, CPU cores, and
database connection limit. Keep the backpressure equal to or higher than the
number of blocking threads.

#### SEE ALSO
* [Sample configuration to start Granian with ASGI](#running-granian-asgi)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [Como implementar com WSGI](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/)

<a id="running-granian-asgi"></a>

### Sample configuration to start Granian with ASGI

#### Versionadded
Adicionado na versão 2026.8.

ASGI deployment is available as an opt-in alternative to WSGI. Install the
`asgi` optional dependency:

```shell
uv pip install Weblate[all,asgi]
```

The following systemd unit runs the Django ASGI application:

```ini
[Unit]
Description=granian ASGI daemon
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
RuntimeDirectory=granian
ExecStart=/home/weblate/weblate-env/bin/granian \
    --no-ws \
    --workers-max-rss 450 \
    --interface asginl \
    --workers 2 \
    --backlog 128 \
    --backpressure 16 \
    --runtime-mode mt \
    --port 8888 \
    weblate.asgi:application

[Install]
WantedBy=multi-user.target
```

The sample uses Granian’s ASGI interface without lifespan or WebSocket support,
because Weblate currently exposes HTTP only. Weblate’s middleware supports both
deployment modes and uses thread-sensitive adapters where it still relies on
synchronous Django APIs. The health check is asynchronous, but most Weblate
views remain synchronous, and CPU-intensive or long-running work should still
be handled by [Tarefas de fundo usando Celery](#celery).

WSGI remains the default deployment mode. Docker images can opt in to ASGI by
setting [`WEBLATE_ASGI`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_ASGI) to `1`. Adjust the worker count and
backpressure to the available memory, CPU cores, and database connection limit.

#### SEE ALSO
* [Sample configuration to start Granian](#running-granian)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [Como fazer o deploy com ASGI](https://docs.djangoproject.com/pt-br/stable/howto/deployment/asgi/)

<a id="running-gunicorn"></a>

### Amostra de configuração para iniciar Gunicorn

Gunicorn has to be installed separately:

```shell
uv pip install gunicorn
```

Depois que você tiver o Gunicorn instalado, você pode executá-lo. Isso geralmente é feito no nível do sistema. Os exemplos a seguir mostram a inicialização via systemd:

```ini
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target
```

```ini
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
ExecStart=/home/weblate/weblate-env/bin/gunicorn \
    --preload \
    --timeout 3600 \
    --graceful-timeout 3600 \
    --worker-class=gthread \
    --workers=2 \
    --threads=16 \
    --bind unix:/run/gunicorn.sock \
    weblate.wsgi:application

[Install]
WantedBy=multi-user.target
```

#### SEE ALSO
[Como usar o Django com o Gunicorn](https://docs.djangoproject.com/pt-br/stable/howto/deployment/wsgi/gunicorn/)

### Rodando Weblate sob o caminho

Recomenda-se o uso de prefork de MPM ao usar WSGI com Weblate.

A sample Apache configuration to serve Weblate under `/weblate`. Again using
`mod_wsgi` (`weblate/examples/apache-path.conf` in the source tree):

```apache
#
# VirtualHost for Weblate, running under /weblate path
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match Python version mod-wsgi is compiled for
# - change weblate user to match your Weblate user
#
<VirtualHost *:80>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /weblate/favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /weblate/static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    # Path to your Weblate Python environment
    WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate request-timeout=600
    WSGIProcessGroup weblate
    WSGIApplicationGroup %{GLOBAL}

    WSGIScriptAlias /weblate /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py process-group=weblate
    WSGIPassAuthorization On

    <Directory /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/>
        <Files wsgi.py>
        Require all granted
        </Files>
    </Directory>

</VirtualHost>
```

Adicionalmente, você irá ter de ajustar o `weblate/settings.py`:

```python
URL_PREFIX = "/weblate"
```

<a id="celery"></a>

## Tarefas de fundo usando Celery

Weblate usa Celery para executar tarefas regulares e em segundo plano. Você deve executar um serviço Celery que irá executá-los. Por exemplo, é responsável por lidar com as seguintes operações (esta lista não está completa):

* Receber webhooks de serviços externos (consulte [Ganchos de notificação](https://docs.weblate.org/pt-br/weblate-2026.11.1/api.md#hooks)).
* Executar tarefas de manutenção regulares como backups, limpezas, complementos diários ou atualizações (consulte [Fazendo backup e movendo o Weblate](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/backup.md#backup), [`BACKGROUND_TASKS`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-BACKGROUND_TASKS), [Complementos](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/addons.md#addons)).
* Executar [Tradução automática](https://docs.weblate.org/pt-br/weblate-2026.11.1/user/translating.md#auto-translation).
* Enviar notificações de resumo.
* Descarregando operações dispendiosas do processo WSGI.
* Fazer commits de alterações pendentes (consulte [Commits adiados](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/continuous.md#lazy-commit)).

A typical setup using Valkey or Redis as a backend looks like this:

```python
CELERY_TASK_ALWAYS_EAGER = False
CELERY_BROKER_URL = "redis://localhost:6379"
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
```

#### SEE ALSO
[Redis broker configuration in Celery](https://docs.celeryq.dev/en/stable/getting-started/backends-and-brokers/redis.html#broker-redis-configuration)

You should also start the Celery worker to process the tasks and start scheduled
tasks. For debugging or development, this can be done directly on the
command-line:

```sh
celery --app=weblate.utils worker --beat \
    --queues=celery,notify,memory,translate,backup \
    --prefetch-multiplier=1
```

Running all queues in one prefork worker shares the initial application memory
between its child processes while retaining parallel task execution. Celery
determines the concurrency from the number of available CPUs by default; use
`--concurrency` to adjust it for your workload and available memory.

To reduce startup memory usage, Celery workers do not repeat the Django system
checks. The Weblate container runs the more comprehensive
**weblate check --deploy** automatically during container startup. For
other installation methods, run the command after installation, upgrades, or
configuration changes. The checks are also available in the
[management interface](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/admin.md#manage-performance).

#### NOTE
O processo de Celery deve ser executado sob o mesmo usuário que o Weblate e o processo do WSGI, caso contrário, os arquivos em [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR) serão armazenados com propriedade mista, levando a problemas de tempo de execução.

Consulte também [Permissões do sistema de arquivos](#file-permissions) e [Executando servidor](#server).

### Execução de tarefas de Celery no WSGI usando o modo eager

#### NOTE
Isso terá um impacto severo no desempenho da interface da web e interromperá os recursos dependendo do acionamento normal (por exemplo, fazer commit de alterações pendentes, notificações de resumo ou backups).

Para o desenvolvimento, você pode querer usar uma configuração ansiosa, que processa todas as tarefas no local:

```python
CELERY_TASK_ALWAYS_EAGER = True
CELERY_BROKER_URL = "memory://"
CELERY_TASK_EAGER_PROPAGATES = True
```

### Executando Celery como serviço do sistema

Most likely you will want to run Celery as a daemon and that is covered by
[Daemonization](https://docs.celeryq.dev/en/stable/userguide/daemonizing.html). For the most common Linux setup using
systemd, adapt the example files listed below. These examples are maintained in
the Weblate source tree under `weblate/examples/`; Python wheels do not
install these deployment samples.

Unidade do systemd a ser colocada como `/etc/systemd/system/celery-weblate.service`:

```ini
[Unit]
Description=Celery Service (Weblate)
After=network.target

[Service]
Type=forking
User=weblate
Group=weblate
EnvironmentFile=/etc/default/celery-weblate
WorkingDirectory=/home/weblate
RuntimeDirectory=celery
RuntimeDirectoryPreserve=restart
LogsDirectory=celery
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
  --pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'

[Install]
WantedBy=multi-user.target
```

Configuração do ambiente a ser colocada como `/etc/default/celery-weblate`:

```sh
# Name of nodes to start
CELERYD_NODES="combined"

# Absolute or relative path to the 'celery' command:
CELERY_BIN="/home/weblate/weblate-env/bin/celery"

# App instance to use
# comment out this line if you don't use an app
CELERY_APP="weblate.utils"

# Extra command-line arguments to the worker. Celery determines concurrency
# from the number of available CPUs by default. You might need to customize it
# depending on the available resources and Weblate usage. Increase concurrency
# if you get weblate.E019 error, decrease it on a low-resource system.
# Command-line values override corresponding Celery settings in settings.py.
CELERYD_OPTS="--beat:combined --queues:combined=celery,notify,memory,translate,backup --prefetch-multiplier:combined=1"

# Logging configuration
# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
#   and is important when using the prefork pool to avoid race conditions.
CELERYD_PID_FILE="/run/celery/weblate-%n.pid"
CELERYD_LOG_FILE="/var/log/celery/weblate-%n%I.log"
CELERYD_LOG_LEVEL="INFO"
```

Configuração adicional para alternar os logs do Celery usando **logrotate** a ser colocada como `/etc/logrotate.d/celery`:

```text
/var/log/celery/*.log {
        weekly
        missingok
        rotate 12
        compress
        notifempty
}
```

### Tarefas periódicas usando a batida do Celery

O Weblate vem com configuração embutida para tarefas agendadas. O agendamento de tarefas é armazenado no banco de dados e as tarefas são executadas pelo daemon beat do Celery.

#### HINT
Você pode definir tarefas adicionais em `settings.py`, por exemplo, consulte [Commits adiados](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/continuous.md#lazy-commit).

<a id="monitoring-celery"></a>

### Monitorando status do Celery

Você pode encontrar o comprimento atual das filas de tarefas do Celery na [Interface de gerenciamento](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/admin.md#management-interface) ou você pode usar [`celery_queues`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-celery_queues) na linha de comando. Caso a fila fique muito longa, você também terá erro de configuração na interface administrativa.

#### WARNING
Os erros do Celery são por padrão apenas conectados ao log do Celery e não são visíveis ao usuário. Caso você queira ter uma visão geral sobre tais falhas, recomenda-se ajustar a configuração para ir [Coletando relatórios de erros e monitoramento do desempenho](#collecting-errors).

#### SEE ALSO
* [Monitorando o Weblate](#monitoring)
* [Como posso verificar se o meu Weblate está configurado corretamente?](https://docs.weblate.org/pt-br/weblate-2026.11.1/faq.md#faq-monitoring)
* [Configuration and defaults](https://docs.celeryq.dev/en/stable/userguide/configuration.html)
* [Workers Guide](https://docs.celeryq.dev/en/stable/userguide/workers.html)
* [Daemonization](https://docs.celeryq.dev/en/stable/userguide/daemonizing.html)
* [Monitoring and Management Guide](https://docs.celeryq.dev/en/stable/userguide/monitoring.html)
* [Background tasks internals](https://docs.weblate.org/pt-br/weblate-2026.11.1/contributing/internals.md#background-tasks-internals)
* [`celery_queues`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-celery_queues)

<a id="minimal-celery"></a>

### Configuração do Celery de processo único

Caso sua memória seja muito limitada, talvez você queira reduzir o número de processos do Weblate. Todas as tarefas do Celery podem ser executadas em um único processo usando:

```sh
celery --app=weblate.utils worker --beat --queues=celery,notify,memory,translate,backup --pool=solo
```

An installation using Docker can be configured to use a single-process Celery
setup by setting `CELERY_WORKER_MODE=single`. See
[`CELERY_WORKER_MODE`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-CELERY_WORKER_MODE).

#### WARNING
Isso terá um impacto perceptível no desempenho do Weblate.

<a id="monitoring"></a>

## Monitorando o Weblate

O Weblate fornece a URL `/healthz/` a ser usada em verificações de saúde simples, por exemplo, usando Kubernetes. O contêiner Docker tem verificação de saúde embutida usando esta URL.

For monitoring metrics of Weblate you can use the [`GET /api/metrics/`](https://docs.weblate.org/pt-br/weblate-2026.11.1/api.md#get--api-metrics-) API
endpoint. Monitoring tools running locally can retrieve the same metrics using
the [`metrics`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/management.md#weblate-admin-metrics) command.

#### SEE ALSO
* [Como posso verificar se o meu Weblate está configurado corretamente?](https://docs.weblate.org/pt-br/weblate-2026.11.1/faq.md#faq-monitoring)
* [Monitorando status do Celery](#monitoring-celery)
* [Weblate plugin for Munin](https://github.com/WeblateOrg/munin)

<a id="collecting-errors"></a>

## Coletando relatórios de erros e monitoramento do desempenho

Weblate, como qualquer outro software, pode falhar. Para coletar status de falha úteis, recomendamos usar serviços de terceiros para coletar tais informações. Isso é especialmente útil no caso de falhas nas tarefas do Celery, que de outra forma só relatariam erro nos logs e você não será notificado sobre eles. O Weblate tem suporte para os seguintes serviços:

### E-mail

The default Weblate configuration instruments Django to send e-mails upon
server errors via [`django.utils.log.AdminEmailHandler`](https://docs.djangoproject.com/pt-br/stable/ref/logging/#django.utils.log.AdminEmailHandler). This
is the least effort setup, but you should consider other options for privacy
reasons, as the error e-mails might include sensitive data. You can read more on
that in [Security implications](https://docs.djangoproject.com/pt-br/stable/topics/logging/#logging-security-implications).

To disable this behavior, remove `mail_admins` from the
[`LOGGING`](https://docs.djangoproject.com/pt-br/stable/ref/settings/#std-setting-LOGGING) in Weblate settings, or disable
[`WEBLATE_ADMIN_NOTIFY_ERROR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_ADMIN_NOTIFY_ERROR) in the Docker environment.

### Sentry

O Weblate possui suporte embutido para [Sentry](https://sentry.io/). Para usá-lo, é suficiente definir [`SENTRY_DSN`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SENTRY_DSN) no `settings.py`:

```python
SENTRY_DSN = "https://id@your.sentry.example.com/"
```

O Sentry também pode ser usado para monitorar o desempenho do Weblate, coletando rastros e perfis para uma porcentagem definida de operações. Isso pode ser configurado usando [`SENTRY_TRACES_SAMPLE_RATE`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SENTRY_TRACES_SAMPLE_RATE) e [`SENTRY_PROFILES_SAMPLE_RATE`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-SENTRY_PROFILES_SAMPLE_RATE).

#### SEE ALSO
* [Monitoramento de Desempenho do Sentry](https://docs.sentry.io/product/sentry-basics/performance-monitoring/)
* [Sentry Profiling](https://docs.sentry.io/product/profiling/)

### Google Cloud Error Reporting

Weblate can report handled server errors to [Google Cloud Error Reporting](https://docs.cloud.google.com/error-reporting/docs/grouping-errors).
Install Weblate with the `google-errors` extra and configure
[`GOOGLE_CLOUD_ERROR_REPORTING`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-GOOGLE_CLOUD_ERROR_REPORTING) in `settings.py`:

```python
GOOGLE_CLOUD_ERROR_REPORTING = {
    "project": "your-google-cloud-project",
}
```

Weblate automatically reports errors under the `weblate` service and uses the
current Weblate version or Git revision as the reported version. These values
can be overridden by setting `service` or `version` in
[`GOOGLE_CLOUD_ERROR_REPORTING`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-GOOGLE_CLOUD_ERROR_REPORTING).

### OpenTelemetry

Weblate can export backend traces using [OpenTelemetry](https://opentelemetry.io/).
It uses OTLP over HTTP and can send traces to an OpenTelemetry Collector or a
compatible vendor endpoint.

```python
OPENTELEMETRY_ENABLED = True
OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT = "https://collector.example.com/v1/traces"
OPENTELEMETRY_TRACES_SAMPLE_RATE = 0.1
```

The integration traces Django requests, Celery tasks, Redis, outgoing HTTP
requests, database calls, and Weblate-specific spans. Configure it using
[`OPENTELEMETRY_ENABLED`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-OPENTELEMETRY_ENABLED),
[`OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT), and
[`OPENTELEMETRY_TRACES_SAMPLE_RATE`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-OPENTELEMETRY_TRACES_SAMPLE_RATE).

<a id="rollbar-errors"></a>

### Rollbar

O Weblate tem suporte embutido para [Rollbar](https://rollbar.com/). Para usá-lo, basta seguir instruções para o [notificador de Rollbar para Python](https://docs.rollbar.com/docs/python/).

Em suma, você precisa ajustar `settings.py`:

```python
# Add rollbar as last middleware:
MIDDLEWARE = [
    # … other middleware classes …
    "rollbar.contrib.django.middleware.RollbarNotifierMiddleware",
]

# Configure client access
ROLLBAR = {
    "access_token": "POST_SERVER_ITEM_ACCESS_TOKEN",
    "environment": "development" if DEBUG else "production",
    "branch": "main",
    "root": "/absolute/path/to/code/root",
}
```

Todo o resto é integrado automaticamente, agora você coletará erros do lado do servidor e do cliente.

#### NOTE
O registro de erros também inclui exceções que foram analisadas com cuidado, mas que podem indicar um problema, como a falha na análise de um arquivo enviado.

<a id="graylog"></a>

### Gerenciamento de logs Graylog

#### Versionadded
Adicionado na versão 5.9.

O Weblate pode ser configurado para registrar usando o protocolo GELF TCP. Ele foi desenvolvido para integração com Graylog, mas pode ser usado com qualquer plataforma de registro compatível.

O modelo de configuração está incluído em [Amostra de configuração](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/sample.md#sample-configuration), para o Docker isso pode ser configurado usando [`WEBLATE_LOG_GELF_HOST`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/install/docker.md#envvar-WEBLATE_LOG_GELF_HOST).

## Migrando Weblate para outro servidor

Migrar o Weblate para outro servidor deve ser muito fácil, porém armazena dados em poucos locais que você deve migrar cuidadosamente. A melhor abordagem é parar o Weblate para a migração.

### Migrando banco de dados

The most straightforward approach is to use database native tools, as they are
usually the most effective (e.g. **pg_dump**). Alternatively you can use
replication if your database supports it.

#### SEE ALSO
Migração entre bancos de dados descritos em [Migrando de outros bancos de dados para o PostgreSQL](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/upgrade.md#database-migration).

### Migrando repositórios VCS

Os repositórios VCS armazenados em [`DATA_DIR`](https://docs.weblate.org/pt-br/weblate-2026.11.1/admin/config.md#std-setting-DATA_DIR) também precisam ser migrados. Você pode simplesmente copiá-los ou usar **rsync** para fazer a migração de forma mais eficaz.

### Outras notas

Don’t forget to move other services Weblate might have been using like
Valkey, Redis, Cron jobs or custom authentication backends.
