Skip to content

Quick Start Guide

HolgerHuo edited this page Oct 16, 2024 · 6 revisions

本文有与之对应的中文版本

Introduction

Overleaf is deployed via Docker. Before we start, please install Docker following this documentation. Podman is not supported and tested.

Due to the internal complexity, it can be arduous and complicated to spin up all services without docker, but Overleaf does provide a simple init system. Should you be interested, check out these codes to get some inspiration.

Overleaf provides two images, ghcr.io/lcpu-club/sharelatex-base and ghcr.io/lcpu-club/sharelatex. sharelatex-base contains all texlive binaries and packages (tlmgr install scheme-full) and is used for sandboxed compilation. We provide latest(2024), 2022, 2020 versions of texlive and the image is tagged with {year}.{rev} (rev is a number signifying revision number), e.g. ghcr.io/lcpu-club/sharelatex-base:2024.1. sharelatex contains the application code and is tagged with standard semantic versioning.

Pull all necessary images

docker pull ghcr.io/lcpu-club/sharelatex:latest
docker pull ghcr.io/lcpu-club/sharelatex-base:2024.1
docker pull ghcr.io/lcpu-club/sharelatex-base:2022.1
docker pull ghcr.io/lcpu-club/sharelatex-base:2020.1

Download docker-compose.yml

# First make a new directory
mkdir overleaf && cd overleaf

# wget docker-compose.yml and necessary files
wget https://github.com/lcpu-club/overleaf/raw/refs/heads/main/docker-compose.yml
curl https://github.com/lcpu-club/overleaf/raw/refs/heads/main/server-ce/mongodb-init-replica-set.js -L --create-dirs --output server-ce/mongodb-init-replica-set.js

# modify docker-compose.yml
$EDITOR docker-compose.yml

Please pay attention to following options:

  • volume mounts: by default {sharelatex_data,redis_data,mongo_data} will be stored in ~/, modify as you need.
  • SANDBOXED_COMPILES_HOST_DIR: be especially careful that this directory should be your sharelatex_data directory on the host + /data/compiles as this will be volume mounted into the compile container.
  • other values: update according to your needs. you should set OVERLEAF_BEHIND_PROXY: 'true' OVERLEAF_SECURE_COOKIE: 'true' if you'll use reverse proxy.

Finally, start overleaf with:

docker compose up -d

And now you can head to your Overleaf instance!

Creating and Managing users

Once the Overleaf instance is running, visit the /launchpad page to set up your first admin user.

Altenatively, use the following command to create your first user and make them an admin:

docker exec sharelatex /bin/bash -c "cd /var/www/sharelatex; grunt user:create-admin [email protected]"

This will create a user with the given email address if they don't already exist, and make them an admin user. You will be given a URL to visit where you can set the password for this user and log in for the first time.

NOTE: the command above will always yield a URL pointing to http://localhost/ if you've updated your port forwarding to something like ports: - 8080:80, you should use the correct port to visit the password confirmation page: http://localhost:8080/user/password/set?passwordResetToken=<token>. Another option is to set SHARELATEX_SITE_URL environment variable to http://localhost:8080 or http://sharelatex.mydomain.com.

Creating normal users

Once you are logged in as an admin user, you can visit /admin/register on your Overleaf instance and create new users. If you have an email backend configured the new users will be sent an email with a URL to set their password. If not, you will have to distribute the password reset URLs manually. These are shown when you create a user.

Clone this wiki locally