Overleaf(LaTeX)
Introduction
Overleaf is a Software with that you can edit LaTeX files in a browser. This is a Tutorial on how to setup a self-hosted Overleaf Community Edition server on Linux.
It is intended that you run this server behind a reverse proxy. It is very important to do so if you plan to publish the application to the internet!
Preparation
- Linux server
- git & docker
- Reverse proxy (not included in this tutorial)
# Get packages with the package manager of your distro
sudo dnf install git
## dnf RHEL based (RHEL, Rocky, Alma, Centos, etc.)
## apt Debian based (Debian, Ubuntu, Mint, etc.)
## and so on
# Be sure that your designated user is part of the docker group
## Check it when you are logged in
groups
## If not add your current user
usermod -aG docker $USER
## Or a different one
usermod -aG docker <USERNAME>!Caution!
When using RHEL based os for the server it is recomended to deinstall Podman and install Docker CE. Podman was not tested.
Installation
Sources: Official Additional Instructions Example Implementation Completing Tex Live Ubuntu 20.04 TexLive full Old scheme full
Installation successfully tested on the 19.07.2024
# Make a directory and cahnge the permissions
sudo mkdir /opt/overleaf-toolkit
sudo chown <USERNAME>.root /opt/overleaf-toolkit
# Download git repo to opt and cd into it
git clone https://github.com/overleaf/toolkit.git /opt/overleaf-toolkit
cd /opt/overleaf-toolkit
# ATTENTION: Bug Alert! 19.07.2024
## https://github.com/overleaf/toolkit/issues/272
## Current workaround befor you initialize the project
git checkout 2bc0c9d71bb8e1ab94456b89e0dd7cef7810f4bd
# initialize the project
./bin/init
## (OPTIONAL) change any variable needed in this directory
ls config
vi config/overleaf.rc
----------------START-----------------
## OVERLEAF_LISTEN_IP=127.0.0.1
OVERLEAF_LISTEN_IP=<IP_OF_VM>
----------------STOP------------------
# Add the http service to the local firewall
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
# Test if you can start the application
## This takes some time
./bin/up
# Check if the website is reachable
# Stop the application if needed
./bin/stopConfiguration
# Make the application to a systemd service
vi /etc/systemd/system/overleaf.service
----------------START-----------------
[Unit]
Description=Overleaf Community Edition
[Service]
Type=oneshot
WorkingDirectory=/opt/overleaf-toolkit
ExecStart=/opt/overleaf-toolkit/bin/up -d
ExecStop=/opt/overleaf-toolkit/bin/stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
----------------STOP------------------
# Reload the deamon, enable & start overleaf Service
systemctl daemon-reload
systemctl enable overleaf.service
systemctl start overleaf.service
# Check status of service
systemctl status overleaf.serviceTex Live full install
By default Overleaf Community Edition installs LaTeX in a "lite" version. In order to use the full capabilities of Overleaf it is advised to fully install LaTex (all packages).
Remember, that once you update the image used for Overleaf you need to redo this step. Each time. That's CE Version for you :)
# Change in to working directory
cda
# Enter a shell into the container
./bin/shell
# Update TeX Live Manager
tlmgr update --self
## Display version of TeX Live
tlmgr --version
tlmgr revision 71331 (2024-05-24 09:30:36 +0200)
TeX Live (https://tug.org/texlive) version 2024
# Install full scheme (takes about 10 to 20 min)
tlmgr install scheme-full
# Exit container shell
exitUpdate
# Stop service
systemctl stop overleaf.service
# Change into working directory
cda
# Update
./bin/upgrade
# Stop automaticly started containers
./bin/Stop
# Start service again
systemctl start overleaf.service
## Source: https://github.com/overleaf/toolkit/blob/master/doc/upgrading.md