- Home
- Docs
- Installation
- Community
- Linux version
- Compiling ONLYOFFICE Docs for a local server
Compiling ONLYOFFICE Docs for a local server
Introduction
ONLYOFFICE Docs is an online office suite comprising viewers and editors for text documents, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
You can easily compile ONLYOFFICE Docs from source codes and deploy the solution on your local server using the specially designed build_tools. The build_tools allow you to automatically get and install all the components necessary for the compilation process, all the dependencies required for the ONLYOFFICE Docs correct work, as well as to get the latest version of ONLYOFFICE Docs source code and build all its components.
master branch.System requirements
Hardware
- CPU: 4 cores
- RAM: at least 8 GB, but depends on the host OS. More is better
- SSD: at least 100 GB of free space
- SWAP: at least 4 GB, but depends on the host OS. More is better
Software
- OS: 64-bit Ubuntu 24.04
Installing dependencies
You might need to install Python and Git if they are not yet installed on your computer. This can be done using the following command:
sudo apt-get install -y python3 git
Building ONLYOFFICE Docs source code
-
Clone the build_tools repository:
git clone https://github.com/ONLYOFFICE/build_tools.git -
Go to the
build_tools/tools/linuxdirectory:cd build_tools/tools/linux -
Run the
automate.pyscript specifying theserverparameter to compile the ONLYOFFICE Docs:python3 ./automate.py serverIf you run the script without any parameters, this will build ONLYOFFICE Docs alongside with Document Builder and Desktop Editors.
If necessary, you can build several products at once by running the script with the parameters corresponding to the necessary products. To learn more about compiling Document Builder, you can read this article. To learn more about compiling Desktop Editors, please refer to this article.python3 ./automate.py
Wait while the script is being executed. Depending on your computer capabilities, this process may take considerable time. For example, this takes at least 3 hours on 4x2.3GHz vCPUs.
The script will compile all the dependencies and components which are a part of ONLYOFFICE Docs.
The built ONLYOFFICE Docs will be available in the ../../out/linux_64/onlyoffice/documentserver/ directory.
Installing and configuring NGINX
ONLYOFFICE Docs uses NGINX as a web server.
Installing and configuring NGINX
-
Install NGINX:
sudo apt-get install nginx -
Disable the default website:
sudo rm -f /etc/nginx/sites-enabled/default -
Create the
/etc/nginx/sites-available/onlyoffice-documentserverfile 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; } } -
Add the symlink to the newly created website to the
/etc/nginx/sites-availabledirectory:sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver -
Restart NGINX to apply the changes:
sudo nginx -s reload
Generating fonts 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"
Generating presentation themes
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"
Running ONLYOFFICE Docs
-
Start the FileConverter service:
cd out/linux_64/onlyoffice/documentserver/server/FileConverterLD_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/DocServiceNODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./docservice