To add Overleaf to your Traefik stack you should use the Overleaf Toolkit with very minimal adjustments (taken from this issue comment).
Please read the quick start guide and config guide.
- Clone the toolkit repo into your server
- run
toolkit/bin/init
- Edit
config/overleaf.rc
(more info) to your liking, make sure that:OVERLEAF_LISTEN_IP=0.0.0.0
NGINX_ENABLED=false
- Edit
config/variables.env
to your liking
I call my Traefik network traefik
, but you need to change it to whatever network you have your Traefik instance running on.
Add at the top:
networks:
traefik:
name: traefik
sharelatex:
name: sharelatex
Disable ports (in the sharelatex
service):
#ports:
#- "${OVERLEAF_LISTEN_IP:-127.0.0.1}:${OVERLEAF_PORT:-80}:80"
Add to the sharelatex service:
networks:
- traefik
- sharelatex
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.http.services.sharelatex.loadbalancer.server.port=80
- traefik.http.routers.sharelatex.rule=Host(`overleaf.DOMAIN.TLD`, `www.overleaf.DOMAIN.TLD`)
- traefik.http.routers.sharelatex.entrypoints=websecure
- traefik.http.routers.sharelatex.service=sharelatex
- traefik.http.routers.sharelatex.tls=true
- traefik.http.routers.sharelatex.tls.certresolver=production
Add at the top:
networks:
sharelatex:
name: sharelatex
Add to mongo
service:
networks:
- sharelatex
Add at the top:
networks:
sharelatex:
name: sharelatex
Add to redis
service:
networks:
- sharelatex
- Run
toolkit/bin/up -d
- Follow the quick guide instructions (open
overleaf.DOMAIN.TLD/launchpad
). - If you want a full LaTeX install, or specific LaTeX packages, then follow this guide.