diff options
author | Ivan Davydov <lotigara@lotigara.ru> | 2025-03-23 16:07:46 +0300 |
---|---|---|
committer | Ivan Davydov <lotigara@lotigara.ru> | 2025-03-28 10:41:24 +0300 |
commit | a0f5891f7ebaef61c8ea362b4540d027f633849d (patch) | |
tree | 97571e7e46bf06af8d2f005ffbc54ca7a4aeb79d /README.md | |
parent | 553e884a45de6f67fb842dd281c662db1000cce3 (diff) |
TL;DR: this commit makes README.md more simple and makes scripts more
complex.
This commit makes scripts look (and behave) like scripts.
That is, they now contain shebangs, `echo` lines to allow user
to watch the installation process. The latter is now more configurable:
user can customize the directory, where LibreTranslate will be installed,
username, which will be used to run LibreTranslate and the domain name
configuration is now contained in the .env file, which used for all
other settings.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 51 |
1 files changed, 24 insertions, 27 deletions
@@ -4,42 +4,39 @@ Shell scripts to install [LibreTranslate](https://libretranslate.com) Uses WSGI with [Gunicorn and Nginx](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04). -Tested on Ubuntu 20.04. +Tested on Ubuntu 20.04 and Debian 12. [Known Python version bug with Ubuntu 24.04](https://github.com/LibreTranslate/LibreTranslate/issues/611#issuecomment-2415239429) and Python 3.12. -## Install +## Installation +Please note that you should run these commands as root by adding `sudo` before every command or by entering the root shell using the `sudo su -` command. ``` -# Create libretranslate user -useradd libretranslate -mkdir /home/libretranslate -chown libretranslate:libretranslate /home/libretranslate -usermod -aG sudo libretranslate -passwd -d libretranslate -su libretranslate +# First of all, update the package cache & upgrade the system +apt update +apt dist-upgrade # Download LibreTranslate-init -git clone https://github.com/argosopentech/LibreTranslate-init.git ~/LibreTranslate-init - -# Download dependencies and run LibreTranslate on port 5000 -~/LibreTranslate-init/setup.sh - -# Add your hostname or IP address to this command -# When you run LibreTranslate for the first time it will download all of the language model packages -~/LibreTranslate/env/bin/libretranslate --host <your hostname or IP address> - -# Set server_name to your domain name in ~/LibreTranslate-init/nginx - -# Run LibreTranslate WSGI with nginx and systemd -~/LibreTranslate-init/run.sh - -# Check LibreTranslate status +git clone https://github.com/argosopentech/LibreTranslate-init.git ~/LibreTranslate-init && cd LibreTranslate-init + +# Fill up the .env file with settings +cat > .env <<EOF +# The directory where LibreTranslate will be located +LT_DIR="/var/lib/libretranslate" +# The user LibreTranslate will run under +LT_USER="libretranslate" +# The domain name LibreTranslate will be accessible on +LT_DOMAIN="lt.example.com" +EOF + +# Use the automated install +./setup.sh + +# Ensure that LibreTranslate runs sudo systemctl status libretranslate -# Enable https -~/LibreTranslate-init/get-cert.sh - +# Enable SSL after testing (powered by Certbot and Let's Encrypt) +./get-cert.sh ``` #### Tutorials |