# What is the Overleaf Toolkit?

The Overleaf Toolkit is the **recommended** deployment method for on-premises installations of the Community Edition and Server Pro and has been designed to work with the most common environment: a single physical server or virtual machine. The Toolkit uses `docker compose` to manage your server's Docker containers and provides a set of scripts which wrap `docker` commands to assist with the more technical side of managing an on-premises version of Overleaf.

### The `bin/docker-compose` wrapper

The `bin/docker-compose` script is a wrapper around `docker compose`. It loads configuration from the `config/` directory, before invoking `docker compose` with whatever arguments were passed to the script.

You can treat `bin/docker-compose` as a transparent wrapper for the `docker compose` program installed on your machine.

For example, we can check which containers are running with the following:

```
$ bin/docker-compose ps
```

### Convenience helpers

In addition to `bin/docker-compose`, the Toolkit also provides a collection of convenient scripts to assist with common tasks:

* `bin/up`: shortcut for `bin/docker-compose up`
* `bin/start`: shortcut for `bin/docker-compose start`
* `bin/stop`: shortcut for `bin/docker-compose stop`
* `bin/shell`: starts a shell inside the **sharelatex** container
* `bin/doctor`: script used to gather installation and deployment information. See [Checking your server](#checking-your-server) section below
* `bin/mongo`: starts a shell inside the **mongo** container and switch to the correct database (**sharelatex**)
* `bin/backup-config`: used to create a copy, zip or tar of your current configuration and then store in a destination directory of your choice
* `bin/logs`: script used for easily viewing/tailing service logs
* `bin/error-logs`: script used for easily viewing/tailing service error logs
* `bin/rename-env-vars-5-0`: migration script used to update environment variables in **config/variables.env** as part of the re-branding from ShareLaTeX to Overleaf
* `bin/rename-rc-vars`: migration script used to update environment variables in **config/overleaf.rc** as part of the re-branding from ShareLaTeX to Overleaf
* `bin/run-script`: helper script used to simplify running scripts that are stored within the **sharelatex** container&#x20;
* `bin/upgrade`: script used to assist with instance upgrades. The script with check for updates to the Toolkit code (via git) and offer to pull any new changes. It will then check for the latest available version of the Docker image currently in use and offer to update it. The script provides step-by-step confirmation, the option to take a backup of current configuration and handles the stopping/starting of Docker services. See [Upgrading your deployment](https://docs.overleaf.com/on-premises/maintenance/upgrading-your-deployment) for more information.&#x20;

{% hint style="info" %}
If you prefer to run your instance without attaching to the Docker logs you can run `bin/up -d` to run in detached mode.
{% endhint %}

### Checking your server

The Overleaf Toolkit includes a handy script called `bin/doctor` that produces a report pointing to any unfulfilled dependency.

Before we continue any further, let's run the `bin/doctor` script and check that everything is working correctly.

```
bin/doctor
```

We should see some output similar to this:

```
====== Overleaf Doctor ======
- Host Information
    - Linux
    - Output of 'lsb_release -a':
            No LSB modules are available.
            Distributor ID:     Ubuntu
            Description:        Ubuntu 22.04.5 LTS
            Release:    22.04
            Codename:   jammy
- Dependencies
    - bash
        - status: present
        - version info: 5.1.16(1)-release
    - docker
        - status: present
        - version info: Docker version 27.3.1, build ce12230
    - realpath
        - status: present
        - version info: realpath (GNU coreutils) 8.32
    - perl
        - status: present
        - version info: 5.034000
    - awk
        - status: present
        - version info: GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
    - openssl
        - status: present
        - version info: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
    - docker compose
        - status: present
        - version info: Docker Compose version v2.29.7
- Docker Daemon
    - status: up
====== Configuration ======
- config/version
    - status: present
    - version: 5.1.1
- config/overleaf.rc
    - status: present
    - values
        - OVERLEAF_DATA_PATH: data/overleaf
        - OVERLEAF_LOG_PATH: data/overleaf/logs
        - SERVER_PRO: true
            - logged in to quay.io: true
        - SIBLING_CONTAINERS_ENABLED: true
        - OVERLEAF_LISTEN_IP: 0.0.0.0
        - OVERLEAF_PORT: 80
        - MONGO_ENABLED: true
        - MONGO_IMAGE: mongo
        - MONGO_VERSION: 6.0
        - MONGO_DATA_PATH: data/mongo
        - REDIS_ENABLED: true
        - REDIS_IMAGE: redis:6.2
        - REDIS_DATA_PATH: data/redis
- config/variables.env
    - status: present
    - values
        - OVERLEAF_FILESTORE_BACKEND: fs
        - OVERLEAF_HISTORY_BACKEND: fs
====== Warnings ======
- None, all good
====== End ======

```

First, we see some information about the host system (the machine that the Toolkit is being run on), then some information about dependencies. If any dependencies are missing, we will see a warning here. Next, the doctor checks our local configuration. At the end, the doctor will print out some warnings, if any problems were encountered. For example, if you're running end-of-life versions of Docker or Docker Compose.

If you run into problems with running the Toolkit, you should first run the `bin/doctor` script and check it's output for any warnings.

{% hint style="info" %}
Users of the free Community Edition should open an issue on [GitHub](https://github.com/overleaf/toolkit/issues).

Users of Server Pro should contact <support+serverpro@overleaf.com> for assistance.

In **both** cases, it is a good idea to include the output of the `bin/doctor` script in your message.
{% endhint %}
