---
title: How to Deploy Overleaf – Open-Source LaTeX Collaboration Platform
url: https://docs.vultr.com/how-to-deploy-overleaf-open-source-latex-collaboration-platform
description: Deploy Overleaf Community Edition with Docker Compose, Traefik, HTTPS, MongoDB, and Redis.
publish_date: 2026-02-17T15:20:46.459796Z
last_updated: 2026-09-11T16:42:26.196832Z
author: Oluwadamilola Oshungboye
header_image: https://assets.vultrdevrel.com/docs-main-doc-assets-1/2483/967f829a-0b0c-401e-8ba2-84ed6d83bbef.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

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:

* Have access to a [Linux based server](https://www.vultr.com/servers/ubuntu/) as a [non-root user with sudo privileges](https://docs.vultr.com/how-to-create-a-sudo-user-in-linux).
* [Install Docker and Docker Compose](https://docs.vultr.com/how-to-install-docker-on-ubuntu-24-04#install-docker).
* Create a [DNS A record](https://docs.vultr.com/products/network/dns/management/manage-records) pointing to your server's IP address (for example, `overleaf.example.com`).

## 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
    ```

1. Switch to the Overleaf Toolkit directory.

    ```console
    $ cd ~/overleaf-toolkit
    ```

1. 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.

1. Create the directory for the Traefik route configuration.

    ```console
    $ mkdir traefik-routes
    ```

1. Open the `variables.env` file using a text editor.

    ```console
    $ nano config/variables.env
    ```

1. 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.

1. Open the main `overleaf.rc` configuration file.

    ```console
    $ nano config/overleaf.rc
    ```

1. 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.

1. 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.

1. 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.

1. 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
    ```

1. Apply the new group membership to your current session.

    ```console
    $ newgrp docker
    ```

1. 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.

1. 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.

1. 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
    ```

1. Start the Traefik reverse proxy container.

    ```console
    $ docker compose -f docker-compose.traefik.yml up -d
    ```

1. 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
    ```

1. 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
    ```

1. Enter an email address and a strong password in the registration form.

    ![Overleaf Admin Registration Form](https://assets.vultrdevrel.com/docs-main-doc-assets-1/2483/37994753-81b8-4cca-9f54-d827f1c20bb6.png)

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

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

    ![Overleaf Welcome Page](https://assets.vultrdevrel.com/docs-main-doc-assets-1/2483/43f77c83-1cce-4b4a-80da-03b1cc777578.png)

### Create Additional Users

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

    ```
    https://overleaf.example.com/admin
    ```

1. Click **Manage Users** to view the user management interface.

    ![Overleaf User Management Interface](https://assets.vultrdevrel.com/docs-main-doc-assets-1/2483/c94fe796-0a37-463f-ad20-ac005cc1c4c1.png)

1. 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
    ```

1. Click **Create a new project** and select **Example project** from the available options.

    ![Overleaf New Project Options](https://assets.vultrdevrel.com/docs-main-doc-assets-1/2483/3a71a7ba-056a-48e3-9a7d-1b07687dbe29.png)

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

1. The editor opens with a default LaTeX template.

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

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

1. 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](https://github.com/overleaf/toolkit/tree/master/doc).
