How to Deploy Overleaf – Open-Source LaTeX Collaboration Platform

Updated on 19 February, 2026
Deploy Overleaf Community Edition with Docker Compose, Traefik, HTTPS, MongoDB, and Redis.
How to Deploy Overleaf – Open-Source LaTeX Collaboration Platform header image

Overleaf is an open-source LaTeX editor with a browser-based interface. It supports real-time collaboration, allowing multiple users to edit the same LaTeX document simultaneously. The Community Edition is the self-hosted variant, built for deployment on private infrastructure.

This article covers the deployment of Overleaf Community Edition on Linux using Docker Compose. It explains how to configure the Overleaf Toolkit and secure the installation with HTTPS using a Traefik reverse proxy.

Prerequisites

Before you begin, you need to:

Set Up the Directory Structure, Configuration, and Environment Variables

The Overleaf Toolkit manages MongoDB, Redis, and the Overleaf application as a single Docker Compose stack. Application configuration resides in config/overleaf.rc and config/variables.env. A separate Traefik container handles TLS termination and certificate provisioning through Let's Encrypt.

  1. Clone the official Overleaf Toolkit repository to your home directory.

    console
    $ git clone https://github.com/overleaf/toolkit.git ~/overleaf-toolkit
    
  2. Switch to the Overleaf Toolkit directory.

    console
    $ cd ~/overleaf-toolkit
    
  3. Initialize the configuration files using the provided initialization script.

    console
    $ bin/init
    

    The above command creates a config directory with three configuration files:

    • overleaf.rc: The main configuration file that controls top-level settings for your Overleaf instance.
    • variables.env: Environment variables that are loaded into the Docker containers.
    • version: Specifies the version of the Overleaf Docker images to use.
  4. Create the directory for the Traefik route configuration.

    console
    $ mkdir traefik-routes
    
  5. Open the variables.env file using a text editor.

    console
    $ nano config/variables.env
    
  6. Locate the Overleaf configuration variables and update them as follows:

    • Set a custom application name.
    • Uncomment and configure the required site and proxy settings.
    • Replace overleaf.example.com with your actual domain name.
    ini
    OVERLEAF_APP_NAME="My Overleaf Instance"
    OVERLEAF_SITE_URL=https://overleaf.example.com
    OVERLEAF_NAV_TITLE="Overleaf CE"
    OVERLEAF_BEHIND_PROXY=true
    OVERLEAF_SECURE_COOKIE=true
    

    Save and close the file.

    Note
    OVERLEAF_BEHIND_PROXY and OVERLEAF_SECURE_COOKIE are required when Overleaf runs behind a reverse proxy. Omitting these causes cookie and redirect failures under HTTPS.
  7. Open the main overleaf.rc configuration file.

    console
    $ nano config/overleaf.rc
    
  8. Set SIBLING_CONTAINERS_ENABLED to false. The Community Edition does not support sibling containers. Leaving this enabled prevents the application from starting.

    ini
    SIBLING_CONTAINERS_ENABLED=false
    

    Save and close the file.

    The overleaf.rc file controls:

    • OVERLEAF_DATA_PATH: Directory where Overleaf stores project data.
    • SIBLING_CONTAINERS_ENABLED: Must be set to false for the Community Edition.
    • MONGO_ENABLED: Enables the bundled MongoDB container.
    • REDIS_ENABLED: Enables the bundled Redis container for caching.
    • OVERLEAF_PORT: The port the Overleaf container listens on.
  9. Create a .env file in the toolkit directory to store the shared environment variables. Replace the values as indicated below.

    console
    $ nano .env
    

    Add the following environment variables:

    ini
    DOMAIN=overleaf.example.com
    LETSENCRYPT_EMAIL=admin@example.com
    SERVER_IP=192.0.2.1
    

    Replace:

    • overleaf.example.com with your registered domain name.
    • admin@example.com with your email address.
    • 192.0.2.1 with your server's public IP address.

    Save and close the file.

  10. Create the Traefik route file for Overleaf.

    console
    $ nano traefik-routes/overleaf.yml
    

    Add the following configuration. Replace overleaf.example.com with your registered domain name:

    yaml
    http:
      routers:
        overleaf:
          rule: "Host(`overleaf.example.com`)"
          service: overleaf
          entryPoints:
            - websecure
          tls:
            certResolver: le
      services:
        overleaf:
          loadBalancer:
            servers:
              - url: "http://sharelatex:80"
    

    Save and close the file.

    The Overleaf Toolkit does not add Traefik labels to its generated containers. This static route file tells Traefik how to reach the sharelatex container on the internal Docker network without requiring labels.

  11. Create the Docker Compose file for the Traefik container.

    console
    $ nano docker-compose.traefik.yml
    

    Add the following manifest:

    yaml
    services:
      traefik:
        image: traefik:v3.6
        container_name: traefik
        restart: unless-stopped
        command:
          - "--providers.docker=true"
          - "--providers.docker.exposedbydefault=false"
          - "--providers.file.directory=/etc/traefik/routes"
          - "--entrypoints.web.address=:80"
          - "--entrypoints.websecure.address=:443"
          - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
          - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
          - "--certificatesresolvers.le.acme.httpchallenge=true"
          - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
          - "--certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}"
          - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
        ports:
          - "${SERVER_IP}:80:80"
          - "${SERVER_IP}:443:443"
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - ./letsencrypt:/letsencrypt
          - ./traefik-routes:/etc/traefik/routes
        networks:
          - overleaf_default
    
    networks:
      overleaf_default:
        external: true
    

    Save and close the file.

    Traefik joins the overleaf_default network that the Overleaf Toolkit creates. Binding the host ports to the server's public IP avoids a conflict with the Overleaf container, which binds to 127.0.0.1 on the same host. Port 80 handles the Let's Encrypt HTTP challenge and the HTTP-to-HTTPS redirect. Port 443 serves all proxied HTTPS traffic.

Deploy with Docker Compose

The Overleaf Toolkit starts MongoDB, Redis, and the Overleaf application container. Traefik runs as a separate service on the same Docker network and handles TLS termination.

Note
The Overleaf Toolkit uses shell scripts to manage the Docker Compose deployment. Review the scripts in the bin/ directory before running them to understand their functionality.
  1. Add your user account to the docker group to run Docker commands without sudo. This is required for the Overleaf Toolkit scripts to function correctly.

    console
    $ sudo usermod -aG docker $USER
    
  2. Apply the new group membership to your current session.

    console
    $ newgrp docker
    
  3. Run the Overleaf Toolkit doctor script to verify all dependencies are installed correctly.

    console
    $ bin/doctor
    

    The output displays the host information, dependency checks, and the Docker daemon status. Verify that all dependencies show status: present and the Docker daemon shows status: up.

    Note
    The warning about SIBLING_CONTAINERS_ENABLED=false is expected for the Community Edition. It indicates that users have full access to the sharelatex container resources during LaTeX compiles. Only use this mode in environments where all users are trusted.
  4. Start the Overleaf containers in detached mode.

    console
    $ bin/up -d
    

    This command starts the following services:

    • sharelatex: The main Overleaf application container.
    • mongo: MongoDB database for storing user data and project metadata.
    • redis: Redis server for caching and session management.
  5. Check the status of all running containers.

    console
    $ bin/docker-compose ps
    

    Output:

    NAME         IMAGE                         STATUS
    mongo        mongo:8.0                     Up (healthy)
    redis        redis:7.4                     Up
    sharelatex   sharelatex/sharelatex:6.1.0   Up
  6. Start the Traefik reverse proxy container.

    console
    $ docker compose -f docker-compose.traefik.yml up -d
    
  7. Verify that the Traefik container is running.

    console
    $ docker compose -f docker-compose.traefik.yml ps
    

    Output:

    NAME      IMAGE            STATUS
    traefik   traefik:v3.6     Up
  8. Confirm that Traefik has applied the route and provisioned the TLS certificate by checking the logs.

    console
    $ docker compose -f docker-compose.traefik.yml logs traefik
    

    The log output contains entries indicating that the route was applied and the certificate was obtained from Let's Encrypt. Initial certificate provisioning may take a few seconds after the container starts.

Access and Configure Overleaf

Overleaf requires an administrator account before you can create LaTeX projects. The registration page is available at the /launchpad path on first access.

  1. Open your browser and navigate to the Overleaf launchpad page. Replace overleaf.example.com with your registered domain name.

    https://overleaf.example.com/launchpad
  2. Enter an email address and a strong password in the registration form.

    Overleaf Admin Registration Form

  3. Click Register to create the administrator account. You are redirected to the login page.

  4. Enter your administrator email and password to log in to Overleaf. The welcome page displays after a successful login.

    Overleaf Welcome Page

Create Additional Users

  1. Navigate to the Admin panel. Replace overleaf.example.com with your registered domain name.

    https://overleaf.example.com/admin
  2. Click Manage Users to view the user management interface.

    Overleaf User Management Interface

  3. Use the user management interface to create new user accounts or manage existing users.

Create and Compile a LaTeX Project

Overleaf supports multiple simultaneous projects. Each project has its own editor and a PDF compilation pipeline that runs inside the sharelatex container.

  1. Navigate to the Overleaf project dashboard. Replace overleaf.example.com with your registered domain name.

    https://overleaf.example.com/project
  2. Click Create a new project and select Example project from the available options.

    Overleaf New Project Options

  3. Enter a name for your project, such as My First Document, and click Create.

  4. The editor opens with a default LaTeX template.

  5. Make some changes, then click Recompile to compile the document.

  6. Verify that the PDF preview panel displays the compiled document.

  7. Click Download PDF to download the compiled document to your workstation.

Conclusion

You have deployed Overleaf Community Edition on Ubuntu 24.04 using Docker Compose and secured the installation with HTTPS through a Traefik reverse proxy. The platform manages MongoDB, Redis, and the Overleaf application, with TLS certificates provisioned and renewed automatically through Let's Encrypt. For more information, refer to the official Overleaf Toolkit documentation.

Comments