Prerequisites
Overleaf is a typical open-source project for microservice architecture, with all services running in Docker.- The Official Community Edition source code is on GitHub Overleaf Official.
- The source code for Overleaf-CEP is available on GitHub Yu-i-i/Overleaf.
- Overleaf Pro Edition is availabe on GitHub Ayaka-notes/overleaf-pro.
Since servers with 8 or more CPU cores are typically expensive, It’s highly recommend using your local computer for development.
- A powerful server/desktop to develop
- A recent and stable Ubuntu LTS (e.g. Ubuntu 24.04)
- Docker and Git environment
Configuration Tutorial
Here, we will use overleaf-cep as an example to demonstrate how to configure an Overleaf development environment.1
Pull the Source Code
First of all let’s clone the repo:
bash
2
Synchronize package-lock.json
Since Overleaf is developed in an internal repository, the If you don’t have nodejs installed, don’t be worried, you can directly use
package-lock.json file is very likely to become out of sync due to some development issues. We need to run the following command to synchronize it. (if you have your local nodejs environment)bash
docker to run the same command. run from the root of the Overleaf repository:bash
3
Build Develop Image
Overleaf provides a dedicated directory
/develop for storing development scripts. Just build the services:bash
If Docker is running out of RAM while building the services in parallel, create a
.env file in this directory containing COMPOSE_PARALLEL_LIMIT=1.4
Start All Micro Services
Then start the services:Once the services are running, open http://localhost/launchpad to create the first admin account.
bash
You must run
bin/up before run bin/dev commnad. Otherwise you may encounter a series of permission problems.By default admin privilege is not available. you need to add this to
develop/dev.env. After that, you can have access to Admin panel.TeX Live
Compiling a PDF requires building a TeX Live image to handle the compilation inside Docker:.env file in this directory, containing DOCKER_SOCKET_PATH=/var/run/docker.sock.raw
Also, you are welcome to use ayaka-notes/texlive-full, but you can use base tag, which is the minium version of texlive.
Development
To avoid runningbin/build && bin/up after every code change, you can run Overleaf Community Edition in development mode, where services will automatically update on code changes.
To do this, use the included bin/dev script:
node --watch, which will automatically monitor the code and restart the services as necessary.
To improve performance, you can start only a subset of the services in development mode by providing a space-separated list to the bin/dev script:
Starting the
web service in development mode will only update the web service when backend code changes. In order to automatically update frontend code as well, make sure to start the webpack service in development mode as well.Debugging
When run in development mode most services expose a debugging port to which you can attach a debugger such as the inspector in Chrome’s Dev Tools or one integrated into an IDE. The following table shows the port exposed on the host machine for each service:
To attach to a service using Chrome’s remote debugging, go to chrome://inspect/ and make sure Discover network targets is checked. Next click Configure… and add an entry
localhost:[service port] for each of the services you want to attach a debugger to.
After adding an entry, the service will show up as a Remote Target that you can inspect and debug.
Logging
In develop env, overleaf provide a scriptbin/logs, however, you need to install some dependency:

