快速启动文档地址:

https://github.com/overleaf/toolkit/blob/master/doc/quick-start-guide.md

首先安装docker和docker desktop

把overleaf仓库克隆到本地:

1
$ git clone https://github.com/overleaf/toolkit.git ./overleaf-toolkit

进入文件夹:

1
$ cd ./overleaf-toolkit

初始化配置:

1
$ bin/init

可以看到config文件夹出现三个新文件:

1
2
$ ls config
overleaf.rc variables.env version

创建并启动新的docker容器,包括下载和启动:

1
$ bin/up

若出现以下错误:

1
2
3
4
5
6
7
---------------------  ERROR  -----------------------
Invalid MONGO_VERSION: MONGO_VERSION=6.0

MONGO_VERSION must start with the actual major version of mongo, followed by a dot.
Example: MONGO_IMAGE=my.dockerhub.com/custom-mongo
MONGO_VERSION=6.0-custom
--------------------- ERROR -----------------------

需要在lib/shared_function.sh文件里面手动指定mongo镜像的版本

1
2
3
4
5
in lib/shared_function.sh

function read_mongo_version() {
local mongo_image=mongo
local mongo_version=6.0

若出现以下错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Initiating Mongo replica set...
realpath: data/overleaf: No such file or directory

# after creating data/overleaf
Initiating Mongo replica set...
realpath: data/mongo: No such file or directory

# after creating data/mongo
Initiating Mongo replica set...
realpath: data/redis: No such file or directory

# after creating data/redis
Initiating Mongo replica set...
realpath: data/git-bridge: No such file or directory

需要创建以下文件夹:

1
data/overleaf`, `data/redis`, `data/mongo`, `data/git-bridge

启动之后,按control-c停止运行,输入bin/start启动。

之前安装的是最小包,安装完整编译环境文档地址:

https://github.com/overleaf/toolkit/blob/master/doc/ce-upgrading-texlive.md