In this tutorial, we will guide you through the process of installing Weblate on Ubuntu Server. Weblate is an open-source translation management system that offers a user-friendly web interface to manage translations.
Before proceeding with the installation, you should have the following:
The first step is to update your Ubuntu Server to ensure that all packages are up to date. To do this, run the following command:
sudo apt update && sudo apt upgrade
Enter your password if prompted, and wait for the process to finish.
Next, install the necessary packages required for running Weblate. Run the following command to install the packages:
sudo apt install python3-pip python3-venv gettext uwsgi uwsgi-plugin-python3
Again, enter your password if prompted and wait for the process to finish.
It is recommended to run Weblate in a virtual environment. In this step, we will create a virtual environment and activate it. Run the following command to create a virtual environment:
sudo python3 -m venv /opt/weblate
Then, activate the virtual environment using the following command:
source /opt/weblate/bin/activate
You should see the virtual environment activated in your terminal prompt.
Now, we will install Weblate within the virtual environment. Run the following command to install Weblate:
sudo /opt/weblate/bin/pip3 install weblate
Wait for the installation process to finish.
After installing Weblate, you need to configure it with your desired settings. The Weblate configuration file is located in /opt/weblate/etc/weblate.cfg
. You can edit this file using your preferred text editor.
Here is an example configuration file you can use:
[weblate]
work_dir = /opt/weblate
languages = en, fr
default_language = en
send_email = no
[database]
engine = postgresql
name = weblate
user = weblate
password = my-password
[web]
allowed_hosts = my-domain.com
secure_cookies = yes
server_name = my-domain.com
debug = no
Make sure to replace the values in the [database]
section with your desired values.
Once you have configured Weblate, you need to initialize the database. Run the following command to initialize the database:
weblate migrate
This will create the necessary database tables and structures.
Finally, you can start Weblate using the following command:
weblate runserver
This will start Weblate and make it available on http://localhost:8000
. You can replace the IP address with your server's IP address.
To run Weblate in production mode, you can use a web server like NGINX or Apache. Here is an example NGINX configuration file:
server {
listen 80;
server_name my-domain.com;
location / {
include uwsgi_params;
uwsgi_pass unix:/opt/weblate/run/uwsgi.sock;
}
location /static/ {
alias /opt/weblate/var/static;
}
}
And an example systemd service file:
[Unit]
Description=Weblate web app
After=network.target
[Service]
WorkingDirectory=/opt/weblate
ExecStart=/opt/weblate/bin/weblate runuwsgi --http :8000 --uid www-data --gid www-data --processes 4 --cheaper-algo busyness
Restart=on-failure
[Install]
WantedBy=multi-user.target
You have successfully installed Weblate on your Ubuntu Server. Now, you can use Weblate to manage translations for your projects. Happy translating!
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!