Used to build ONLYOFFICE DocumentServer-related products
See the codeWelcome to the build_tools repository! This powerful toolkit simplifies the process of compiling ONLYOFFICE products from source on Linux.
It automatically fetches all the required dependencies and source code to build the latest versions of:
A quick note: For the most stable and reliable builds, we strongly recommend compiling from the master branch of this repository.
This guide has been tested and verified on:
| Component | Specification |
|---|---|
| OS | Ubuntu 24.04 |
| Architecture | amd64 |
| CPU | 4 cores |
| RAM | 8 GB |
| Swap | 4 GB |
| Storage | 100 GB SSD |
First, let's make sure you have Python installed, as it's needed to run the build scripts.
sudo apt-get install -y python
Now, you're ready to build the ONLYOFFICE products.
Clone the build_tools repository:
This command downloads the build tools to your machine using Git:
git clone https://github.com/ONLYOFFICE/build_tools.git
Navigate to the scripts directory:
cd build_tools/tools/linux
Run the automation script:
This is where the magic happens! Running the script without any options will build all three products: Document Server, Document Builder, and Desktop Editors.
python3 ./automate.py
You can also build ONLYOFFICE products separately. Just run the script with the parameter corresponding to the necessary product. For example, to build Desktop Editors and Document Server
python3 ./automate.py desktop server
Perfect! Once the script finishes, you will find the compiled products in the ./out directory.
If you prefer using Docker, you can build all products inside a container. This is a great way to keep your local system clean.
Install Docker https://docs.docker.com/engine/install/
Clone the build_tools repository:
git clone https://github.com/ONLYOFFICE/build_tools.git
Go to the build_tools:
cd build_tools
Create an output directory:
mkdir out
Build the Docker image:
docker build --tag onlyoffice-document-editors-builder .
Run the container to start the build:
This command mounts your local out directory into the container, so the final build files will appear on your machine.
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
You've done it! The results will be in the ./out directory you created.
Don't need everything? You can save time by building only the products you need. Just add the product name as an argument to the script.
How to build
python3 ./automate.py builder
How to run
cd ../../out/linux_64/onlyoffice/documentbuilder
./docbuilder
python3 ./automate.py desktop
cd ../../out/linux_64/onlyoffice/desktopeditors
LD_LIBRARY_PATH=./ ./DesktopEditors
How to build
python3 ./automate.py server
How to run
Running the Document Server is a multi-step process because it relies on a few background services. Let's break it down step by step.
sudo apt-get install nginx
sudo rm -f /etc/nginx/sites-enabled/default
/etc/nginx/sites-available/onlyoffice-documentserver file with the following contents:map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
}
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
sudo nginx -s reload
Before running the server, you need to generate font and theme data.
cd out/linux_64/onlyoffice/documentserver/
mkdir fonts
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
--input="${PWD}/core-fonts" \
--allfonts-web="${PWD}/sdkjs/common/AllFonts.js" \
--allfonts="${PWD}/server/FileConverter/bin/AllFonts.js" \
--images="${PWD}/sdkjs/common/Images" \
--selection="${PWD}/server/FileConverter/bin/font_selection.bin" \
--output-web='fonts' \
--use-system="true"
cd out/linux_64/onlyoffice/documentserver/
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
--converter-dir="${PWD}/server/FileConverter/bin"\
--src="${PWD}/sdkjs/slide/themes"\
--output="${PWD}/sdkjs/common/Images"
All Document Server components run as foreground processes. Thus you need separate terminal consoles to run them or specific tools which will allow to run foreground processes in background mode.
Start the FileConverter service:
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
LD_LIBRARY_PATH=$PWD/bin \
NODE_ENV=development-linux \
NODE_CONFIG_DIR=$PWD/../Common/config \
./converter
Start the DocService service:
cd out/linux_64/onlyoffice/documentserver/server/DocService
NODE_ENV=development-linux \
NODE_CONFIG_DIR=$PWD/../Common/config \
./docservice
Congratulations! You have successfully used the build_tools to compile your desired ONLYOFFICE products from the latest source code.
Everything is now set up. You can go ahead and run your brand-new, self-compiled ONLYOFFICE applications.
Made with ❤️ by the ONLYOFFICE Team
151 followers · starred Aug 2022
Python
97.1%
Used to build ONLYOFFICE DocumentServer-related products
See the codeWelcome to the build_tools repository! This powerful toolkit simplifies the process of compiling ONLYOFFICE products from source on Linux.
It automatically fetches all the required dependencies and source code to build the latest versions of:
A quick note: For the most stable and reliable builds, we strongly recommend compiling from the master branch of this repository.
This guide has been tested and verified on:
| Component | Specification |
|---|---|
| OS | Ubuntu 24.04 |
| Architecture | amd64 |
| CPU | 4 cores |
| RAM | 8 GB |
| Swap | 4 GB |
| Storage | 100 GB SSD |
First, let's make sure you have Python installed, as it's needed to run the build scripts.
sudo apt-get install -y python
Now, you're ready to build the ONLYOFFICE products.
Clone the build_tools repository:
This command downloads the build tools to your machine using Git:
git clone https://github.com/ONLYOFFICE/build_tools.git
Navigate to the scripts directory:
cd build_tools/tools/linux
Run the automation script:
This is where the magic happens! Running the script without any options will build all three products: Document Server, Document Builder, and Desktop Editors.
python3 ./automate.py
You can also build ONLYOFFICE products separately. Just run the script with the parameter corresponding to the necessary product. For example, to build Desktop Editors and Document Server
python3 ./automate.py desktop server
Perfect! Once the script finishes, you will find the compiled products in the ./out directory.
If you prefer using Docker, you can build all products inside a container. This is a great way to keep your local system clean.
Install Docker https://docs.docker.com/engine/install/
Clone the build_tools repository:
git clone https://github.com/ONLYOFFICE/build_tools.git
Go to the build_tools:
cd build_tools
Create an output directory:
mkdir out
Build the Docker image:
docker build --tag onlyoffice-document-editors-builder .
Run the container to start the build:
This command mounts your local out directory into the container, so the final build files will appear on your machine.
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
You've done it! The results will be in the ./out directory you created.
Don't need everything? You can save time by building only the products you need. Just add the product name as an argument to the script.
How to build
python3 ./automate.py builder
How to run
cd ../../out/linux_64/onlyoffice/documentbuilder
./docbuilder
python3 ./automate.py desktop
cd ../../out/linux_64/onlyoffice/desktopeditors
LD_LIBRARY_PATH=./ ./DesktopEditors
How to build
python3 ./automate.py server
How to run
Running the Document Server is a multi-step process because it relies on a few background services. Let's break it down step by step.
sudo apt-get install nginx
sudo rm -f /etc/nginx/sites-enabled/default
/etc/nginx/sites-available/onlyoffice-documentserver file with the following contents:map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
}
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
sudo nginx -s reload
Before running the server, you need to generate font and theme data.
cd out/linux_64/onlyoffice/documentserver/
mkdir fonts
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
--input="${PWD}/core-fonts" \
--allfonts-web="${PWD}/sdkjs/common/AllFonts.js" \
--allfonts="${PWD}/server/FileConverter/bin/AllFonts.js" \
--images="${PWD}/sdkjs/common/Images" \
--selection="${PWD}/server/FileConverter/bin/font_selection.bin" \
--output-web='fonts' \
--use-system="true"
cd out/linux_64/onlyoffice/documentserver/
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
--converter-dir="${PWD}/server/FileConverter/bin"\
--src="${PWD}/sdkjs/slide/themes"\
--output="${PWD}/sdkjs/common/Images"
All Document Server components run as foreground processes. Thus you need separate terminal consoles to run them or specific tools which will allow to run foreground processes in background mode.
Start the FileConverter service:
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
LD_LIBRARY_PATH=$PWD/bin \
NODE_ENV=development-linux \
NODE_CONFIG_DIR=$PWD/../Common/config \
./converter
Start the DocService service:
cd out/linux_64/onlyoffice/documentserver/server/DocService
NODE_ENV=development-linux \
NODE_CONFIG_DIR=$PWD/../Common/config \
./docservice
Congratulations! You have successfully used the build_tools to compile your desired ONLYOFFICE products from the latest source code.
Everything is now set up. You can go ahead and run your brand-new, self-compiled ONLYOFFICE applications.
Made with ❤️ by the ONLYOFFICE Team
151 followers · starred Aug 2022
Python
97.1%