On this page
- What should you know before installing Overleaf?
- How do you set up the Overleaf Toolkit?
- Which configuration values matter most?
- How do you start Overleaf and create an admin?
- How do you put Overleaf behind Nginx with HTTPS?
- How do you install the full TeX Live scheme?
- How do you configure outgoing email?
- How do you back up and upgrade Overleaf?
- What are common Overleaf problems?
- Questions
What should you know before installing Overleaf?
Community Edition is the free, self-hosted version of the collaborative LaTeX editor. The Toolkit is the supported way to run it: a set of shell scripts that start the Overleaf container together with MongoDB and Redis through Docker Compose.
- Memory and CPU: 4 GB of memory is a comfortable start, since compiles of large documents are CPU and memory hungry. Several people compiling at once benefit from 4 vCPU.
- Disk: the full TeX Live scheme adds several gigabytes on top of the images, so leave 20 GB or more free.
- Trust: in Community Edition, compiles run inside the main container without per-user sandboxing. Give accounts only to people you trust, because LaTeX can be made to run shell commands.
Install Docker Engine and the Compose plugin first, using the Docker Engine tutorial or the Docker app image, plus git. Then point an A and AAAA record for latex.example.net at the server.
How do you set up the Overleaf Toolkit?
Clone the repository into a stable path and let the init script write the default configuration:
sudo mkdir -p /opt/overleaf && sudo chown deploy: /opt/overleaf
git clone https://github.com/overleaf/toolkit.git /opt/overleaf/toolkit
cd /opt/overleaf/toolkit
bin/init
ls configThe config folder now holds three files: overleaf.rc for Toolkit options such as ports and which services to run, variables.env for application settings, and version with the release to pull. Your normal user must be able to run Docker, either through the docker group or by prefixing the Toolkit commands with sudo.
Run bin/doctor at any time; it prints a report of the host, Docker versions and configuration that is handy when something goes wrong.
Which configuration values matter most?
In config/overleaf.rc, keep the web container on the loopback interface so only the reverse proxy reaches it:
OVERLEAF_LISTEN_IP=127.0.0.1
OVERLEAF_PORT=8080In config/variables.env, describe how users reach the site and that a proxy handles TLS:
OVERLEAF_APP_NAME="Example LaTeX"
OVERLEAF_SITE_URL=https://latex.example.net
OVERLEAF_NAV_TITLE=Example LaTeX
OVERLEAF_BEHIND_PROXY=true
OVERLEAF_SECURE_COOKIE=true
OVERLEAF_ADMIN_EMAIL=deploy@example.netReleases from 5.0 onward use the OVERLEAF_ prefix; very old installs used SHARELATEX_, and the Toolkit includes a script that migrates such files. Leave the MongoDB and Redis settings in overleaf.rc at their defaults unless you run those services elsewhere.
How do you start Overleaf and create an admin?
Start the stack in the background and watch it come up:
bin/up -d
bin/logs -f webThe first start downloads several images and initialises the MongoDB replica set, which can take a few minutes. When the web service is listening, check it locally:
curl -I http://127.0.0.1:8080/launchpadAfter HTTPS is in place (next section), open https://latex.example.net/launchpad, create the administrator account and log in. From the admin area you add further users; each one receives a link to set a password, which needs working mail.
How do you put Overleaf behind Nginx with HTTPS?
The editor keeps a live WebSocket connection, so the proxy needs the upgrade headers and generous timeouts. Install Nginx and Certbot (sudo apt install nginx certbot python3-certbot-nginx on Ubuntu and Debian; on Rocky and Alma enable epel-release first, install the same packages with dnf, and run sudo setsebool -P httpd_can_network_connect 1). Then add /etc/nginx/conf.d/overleaf.conf:
server {
listen 80;
listen [::]:80;
server_name latex.example.net;
client_max_body_size 50m;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 3m;
proxy_send_timeout 3m;
}
}sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d latex.example.netOpen only ports 80 and 443 to the world, with sudo ufw allow 80,443/tcp or the matching firewall-cmd services, as described in firewall rules.
How do you install the full TeX Live scheme?
The image ships a small TeX Live set to keep downloads short, so many packages are missing at first. Install the complete scheme inside the running container:
cd /opt/overleaf/toolkit
bin/shell
tlmgr update --self
tlmgr install scheme-full
exitThis downloads several gigabytes and can run for a long time. Changes made inside the container are lost when it is recreated, for example during an upgrade, so commit the result to a local image:
V=$(cat config/version)
docker commit sharelatex sharelatex/sharelatex:${V}-with-texlive-full
echo "${V}-with-texlive-full" > config/version
bin/up -dThe Toolkit now starts your committed image instead of the stock one, so the packages survive a recreate. Repeat the install and commit after every upgrade, because a new release starts again from the small set. Check the container name with docker ps first; Toolkit installs use sharelatex by default.
How do you configure outgoing email?
Add SMTP settings to config/variables.env so invitations and password links reach users:
OVERLEAF_EMAIL_FROM_ADDRESS=latex@example.net
OVERLEAF_EMAIL_SMTP_HOST=smtp.example.net
OVERLEAF_EMAIL_SMTP_PORT=587
OVERLEAF_EMAIL_SMTP_SECURE=false
OVERLEAF_EMAIL_SMTP_USER=latex@example.net
OVERLEAF_EMAIL_SMTP_PASS=smtp-passwordApply it with bin/up -d. An authenticated relay on port 587 is the reliable choice; whether port 25 is open outbound is not guaranteed, so raise a support ticket before you plan direct delivery from the server. The SMTP relay guide covers sender records.
How do you back up and upgrade Overleaf?
Project data lives in the data folder of the Toolkit: data/mongo, data/redis and data/overleaf for compiled files and uploads. The safest copy is taken with the stack stopped:
cd /opt/overleaf/toolkit
bin/stop
sudo tar -czf /opt/overleaf-backup-$(date +%F).tar.gz data config
bin/startTo upgrade, run bin/upgrade. It updates the Toolkit scripts, shows the new release, offers to take the stack down, and pulls fresh images. Read the release notes first, because some major versions require a MongoDB upgrade step. If you committed a TeX Live image, rebuild it on top of the new release afterwards.
What are common Overleaf problems?
- Editor stuck on connecting: WebSocket headers are missing in the proxy, or
OVERLEAF_BEHIND_PROXYis not set. - Login loops back to the sign-in page: secure cookies are on but the site is reached over plain HTTP; finish the certificate step.
- Compile fails with a missing .sty file: install the package with
tlmgr installor install the full scheme. - Compiles time out on big theses: the plan is short on CPU; consider a larger plan.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Overleaf Community Edition
Does Community Edition include track changes and SSO?
Those features belong to the commercial Server Pro edition. Community Edition offers real-time co-editing, comments, project sharing and compile history within its own limits.
Can I upload an existing LaTeX project?
Yes. Zip the project folder and use New Project, Upload Project. The main file is detected automatically and can be changed in the project menu.
Is XeLaTeX or LuaLaTeX available?
Both engines are selectable per project in the menu, provided the corresponding TeX Live packages are installed in the container.
Why should only trusted users get accounts?
Community Edition compiles without a per-user sandbox, so a document can execute commands inside the container. Keep sign-up closed and create accounts yourself.
How much disk does a full TeX Live install take?
Several gigabytes on top of the base image. Check free space with df -h before running tlmgr install scheme-full.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM