272 字
1 分钟
云服务器部署overleaf,实现个人latex环境搭建

很喜欢overleaf,感觉比本地vscode配置的latex环境更稳定,但是在线版有时长限制,学校也没买这个,因此决定自己部署一个挂在云服务器上的overleaf。

环境搭建#

Terminal window
sudo apt update
sudo apt install -y docker-compose
git clone https://github.com/overleaf/toolkit.git ./overleaf-toolkit
cd ./overleaf-toolkit
bin/init

配置端口#

首先是经典的在厂商防火墙中打开1222端口:

image-20241028045553715

config/overleaf.rc文件中修改配置。

这里我计划将overleaf的web映射到其他端口I(默认是80),下面我尝试将端口配置在1222

修改文件,把这几行改成:

Terminal window
SERVER_PRO=false
OVERLEAF_LISTEN_IP=0.0.0.0
OVERLEAF_PORT=1222

然后命令行:

Terminal window
sudo bin/up

等一会出现一堆状态后,就可以浏览器访问<服务器ip>:1222来检查了:

image-20241028051833252

但是这里是没账号密码的,可以输入<服务器ip>:1222/launchpad,手动注册一下。

然后可以ctrl+c关掉之前的命令了,用下列命令,挂在后台运行:

Terminal window
sudo bin/start

安装 TexLive#

Terminal window
sudo docker exec -it sharelatex bash
tlmgr install scheme-full

minted包#

需要安装这个

Terminal window
pip install Pygments

中文支持#

详见这两篇博客:

https://www.cnblogs.com/Undefined443/p/18155463

云服务器部署overleaf,实现个人latex环境搭建
https://fuwari.vercel.app/posts/others/overleaf-record/
作者
wegret
发布于
2024-10-28
许可协议
CC BY-NC-SA 4.0