# Instaliranje na Debian i Ubuntu sustavima

## Hardware requirements

Weblate should run on any contemporary hardware without problems, the following is
the minimal configuration required to run Weblate on a single host (Weblate, database
and web server):

* 3 GB of RAM
* 2 CPU cores
* 1 GB of storage space

#### NOTE
Actual requirements for your installation of Weblate vary heavily based on the size of
the translations managed in it.

### Memory usage

The more memory the better - it is used for caching on all
levels (file system, database and Weblate).
For hundreds of translation components, at least 4 GB of RAM is
recommended.

#### HINT
For systems with less memory than recommended, [Single-process Celery setup](https://docs.weblate.org/hr/latest/admin/install.md#minimal-celery) is recommended.

### CPU usage

Many concurrent users increase the amount of needed CPU cores.

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.

### Storage usage

The typical database storage usage is around 300 MB per 1 million hosted words.

Storage space needed for cloned repositories varies, but Weblate tries to keep
their size minimal by doing shallow clones.

### Storage performance

Version control operations perform many filesystem metadata lookups. The
`vcs` subdirectory in [`DATA_DIR`](https://docs.weblate.org/hr/latest/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/hr/latest/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

For small and medium-sized sites (millions of hosted words), all Weblate components (see
[Pregled arhitekture](https://docs.weblate.org/hr/latest/admin/install.md#architecture)) can be run on a single node.

When you grow to hundreds of millions of hosted words, it is recommended to
have a dedicated node for database (see [Database setup for Weblate](https://docs.weblate.org/hr/latest/admin/install.md#database-setup)).

## Installation

### Zahtjevi sustava

Install the dependencies needed to build the Python modules (see [Software requirements](https://docs.weblate.org/hr/latest/admin/install.md#requirements)):

```sh
apt install -y \
   libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev \
   libffi-dev \
   libacl1-dev liblz4-dev libzstd-dev libxxhash-dev libssl-dev libpq-dev libjpeg-dev build-essential \
   python3-gdbm python3-dev git
```

Install wanted optional dependencies depending on features you intend to use (see [Python dependencies](https://docs.weblate.org/hr/latest/admin/install.md#python-deps)):

```sh
apt install -y \
   libldap2-dev libldap-common libsasl2-dev \
   libxmlsec1-dev
```

Optionally install software for running production server, see [Running server](https://docs.weblate.org/hr/latest/admin/install.md#server),
[Database setup for Weblate](https://docs.weblate.org/hr/latest/admin/install.md#database-setup), [Background tasks using Celery](https://docs.weblate.org/hr/latest/admin/install.md#celery). Depending on size of your installation
you might want to run these components on dedicated servers.

The local installation instructions:

```sh
# Web server option 1: NGINX and uWSGI
apt install -y nginx uwsgi uwsgi-plugin-python3

# Web server option 2: Apache with ``mod_wsgi``
apt install -y apache2 libapache2-mod-wsgi-py3

# Caching backend: Valkey
apt install -y valkey-server

# Database server: PostgreSQL
apt install -y postgresql postgresql-contrib

# SMTP server
apt install -y exim4

# Gettext tools for gettext POT/PO update add-ons
apt install -y gettext
```

### uv package manager

#### HINT
We’re using uv package manager to install Weblate.

```sh
curl -LsSf https://astral.sh/uv/install.sh | sh
```

#### SEE ALSO
[Installing uv](https://docs.astral.sh/uv/getting-started/installation/)

### Python moduli

#### HINT
We’re installing Weblate in a separate Python environment.

1. Stvori Python okruženje za Weblate:
   ```sh
   uv venv ~/weblate-env
   ```
2. Activate the Python environment for Weblate:
   ```sh
   . ~/weblate-env/bin/activate
   ```
3. Install Weblate including all optional dependencies:
   ```sh
   # Install Weblate with all optional dependencies
   uv pip install "weblate[all]"
   ```

   Please check [Python dependencies](https://docs.weblate.org/hr/latest/admin/install.md#python-deps) for fine-tuning of optional dependencies.

#### SEE ALSO
* [Using Python environments](https://docs.astral.sh/uv/pip/environments/)
* [Troubleshooting pip install](https://docs.weblate.org/hr/latest/admin/install.md#troubleshoot-pip-install)

### Konfiguriranje Weblatea

#### NOTE
The following assumes the Python environment used by Weblate is activated
(by executing `. ~/weblate-env/bin/activate`). If not, specify the full path
to the **weblate** command as `~/weblate-env/bin/weblate`.

1. Copy the file `~/weblate-env/lib/python3.9/site-packages/weblate/settings_example.py`
   to `~/weblate-env/lib/python3.9/site-packages/weblate/settings.py`.
2. Adjust the values in the new `settings.py` file to your liking. You will
   need to provide at least the database credentials and Django secret key, but
   you will want more changes for production setup, see [Adjusting configuration](https://docs.weblate.org/hr/latest/admin/install.md#configuration).
3. Create the database and its structure for Weblate (the example settings use
   PostgreSQL, check [Database setup for Weblate](https://docs.weblate.org/hr/latest/admin/install.md#database-setup) for a production-ready setup):
   ```sh
   weblate migrate
   ```

   #### SEE ALSO
   [`migrate`](https://docs.weblate.org/hr/latest/admin/management.md#weblate-admin-migrate)
4. Create an administrator user account `admin`, generate its password, and copy it
   to the clipboard; remember to save it for later use:
   ```sh
   weblate createadmin
   ```

   #### HINT
   If you previously missed/lost the admin password, you can generate a new one with the following command:
   ```sh
   weblate createadmin --update
   ```

   #### SEE ALSO
   [`createadmin`](https://docs.weblate.org/hr/latest/admin/management.md#weblate-admin-createadmin)
5. Collect the static files for your web server (see [Running server](https://docs.weblate.org/hr/latest/admin/install.md#server) and [Serving static files](https://docs.weblate.org/hr/latest/admin/install.md#static-files)):
   ```sh
   weblate collectstatic
   ```
6. Start the Celery workers. This is not necessary for development purposes, but
   strongly recommended otherwise. [Background tasks using Celery](https://docs.weblate.org/hr/latest/admin/install.md#celery) has more info:
   ```sh
   celery --app=weblate.utils worker --beat \
       --queues=celery,notify,memory,translate,backup \
       --prefetch-multiplier=1
   ```
7. Start the development server ([Running server](https://docs.weblate.org/hr/latest/admin/install.md#server) details a production setup):
   ```sh
   weblate runserver
   ```

## Nakon instalacije

Congratulations, your Weblate server is now running and you can start using it.

* You can now access Weblate on `http://localhost:8000/`.
* Sign in with admin credentials obtained during installation or register with new users.
* You can now run Weblate commands using **weblate** command when
  Weblate Python environment is active, see [Management commands](https://docs.weblate.org/hr/latest/admin/management.md#manage).
* You can stop the test server with `Ctrl`+`C`.
* Review potential issues with your installation either on `/manage/performance/` URL (see [Izvještaj o preformansi](https://docs.weblate.org/hr/latest/admin/admin.md#manage-performance)) or using **weblate check --deploy**, see [Production setup](https://docs.weblate.org/hr/latest/admin/install.md#production).

### Dodavanje prijevoda

1. Open the admin interface (`http://localhost:8000/create/project/`) and create the project you
   want to translate. See [Konfiguracija projekta](https://docs.weblate.org/hr/latest/admin/projects.md#project) for more details.

   All you need to specify here is the project name and its website.
2. Create a component which is the real object for translation - it points to the
   VCS repository, and selects which files to translate. See [Konfiguracija komponente](https://docs.weblate.org/hr/latest/admin/projects.md#component)
   for more details.

   The important fields here are: [Ime komponente](https://docs.weblate.org/hr/latest/admin/projects.md#component-name), [Repozitorij izvornog koda](https://docs.weblate.org/hr/latest/admin/projects.md#component-repo),
   and [Maska datoteke](https://docs.weblate.org/hr/latest/admin/projects.md#component-filemask) for finding translatable files. Weblate
   supports a wide range of formats including [GNU gettext PO (Portable Object)](https://docs.weblate.org/hr/latest/formats/gettext.md#gettext), [Resursi Android izraza](https://docs.weblate.org/hr/latest/formats/android.md#aresource),
   [Apple iOS izrazi](https://docs.weblate.org/hr/latest/formats/apple.md#apple), [Java svojstva](https://docs.weblate.org/hr/latest/formats/java.md#javaprop), [Stringsdict format](https://docs.weblate.org/hr/latest/formats/stringsdict.md#stringsdict) or [Fluent format](https://docs.weblate.org/hr/latest/formats/fluent.md#fluent), see
   [Localization file formats](https://docs.weblate.org/hr/latest/formats.md#formats) for more details.
3. Once the above is completed (it can be lengthy process depending on the size of
   your VCS repository, and number of messages to translate), you can start
   translating.
