- Home
- Docs
- Installation
- Community
- Linux version
- Installing ONLYOFFICE Docs for CentOS and derivatives
Installing ONLYOFFICE Docs for CentOS and derivatives
Introduction
Community Edition allows you to install ONLYOFFICE Docs on your local server and integrate online editors with ONLYOFFICE collaboration platform or other popular systems.
ONLYOFFICE Docs is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Functionality
- Document Editor
- Spreadsheet Editor
- Presentation Editor
- Mobile web viewers
- Collaborative editing
- Hieroglyph support
- Support for all the popular formats: DOC, DOCX, TXT, ODT, RTF, ODP, EPUB, ODS, XLS, XLSX, CSV, PPTX, HTML
See the detailed list of features available for ONLYOFFICE Docs Community Edition.
Using it within ONLYOFFICE Workspace, you will be able to:
- share files;
- manage access rights to documents;
- embed documents on a website;
- view and edit files stored on Drive, Box, Dropbox, OneDrive, ownCloud connected to ONLYOFFICE.
This guide will show you how to install ONLYOFFICE Docs Community Edition Linux version to your machine.
System requirements
- CPU: dual core 2 GHz or better
- RAM: at least 2 GB, but depends on the host OS. More is better
- HDD: at least 40 GB of free space
- SWAP: at least 4 GB, but depends on the host OS. More is better
- OS: CentOS Stream 9, RHEL 8, or RHEL 9
-
Additional requirements:
- NGINX: version 1.30 or later
Installing dependencies
Installing the up-to-date NGINX package version
To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
Install NGINX:
sudo yum install nginx
After that, edit the /etc/nginx/nginx.conf NGINX configuration file, so that it looked the following way:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Installing EPEL repository
sudo yum install epel-release
To install EPEL on CentOS 9, use the following commands:
sudo yum config-manager --set-enabled crb
sudo yum install epel-release epel-next-release
To install EPEL on RHEL, use the following commands:
sudo subscription-manager repos --enable codeready-builder-for-rhel-$REV-$(arch)-rpms
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm
Change $REV to your OS version manually (7 for versions 7.x, 8 for versions 8.x, 9 for versions 9.x and so on).
Adding the ONLYOFFICE Docs repository
Add the yum ONLYOFFICE Docs repository with the following command:
sudo yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm
Installing mscorefonts
Install the cabextract and xorg-x11-font-utils packages:
sudo yum install cabextract xorg-x11-font-utils
For CentOS 7.8(2003), fontconfig is also required:
sudo yum install fontconfig
Install the msttcore fonts package:
sudo rpm -i https://sourceforge.net/projects/mscorefonts2/files/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
Installing ONLYOFFICE Docs
Execute the following command for the Community edition:
sudo yum install onlyoffice-documentserver
Start the nginx service and enable start on boot:
sudo service nginx start
sudo systemctl enable nginx
After that, ONLYOFFICE Docs will be run as a process. The package will be updated just like any other rpm package.
Updating ONLYOFFICE Docs
To update ONLYOFFICE Docs, run the following command:
sudo yum update onlyoffice-documentserver
yum update with the ONLYOFFICE repository enabled may fail with a dependency error.
To prevent this, exclude these packages from the ONLYOFFICE repository so that they are sourced from the system AppStream repository instead:
echo "excludepkgs=xorg-x11-server-Xvfb,xorg-x11-server-common" >> /etc/yum.repos.d/onlyoffice.repo
This command only needs to be run once. After that, yum update will work as expected.
If you installed ONLYOFFICE Docs via OneClick Install, this exclusion is already applied automatically.
Changing the default ONLYOFFICE Docs port
By default, ONLYOFFICE Docs listens for the incoming connections using port 80. Starting with version 4.3 you can change the port for ONLYOFFICE Docs if you plan to use it instead of the default one.
To do that, you will need to edit the DS_PORT environment variable running the command:
export DS_PORT=<PORT_NUMBER>
Please write the port number instead of the <PORT_NUMBER> in the above command.
After that, you can continue configuring ONLYOFFICE Docs.
Configuring ONLYOFFICE Docs
Run a configuration script
Run the documentserver-configure.sh script:
bash documentserver-configure.sh
Add a firewall exception
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
Disable SELinux
Open the /etc/selinux/config file using any text editor, replace the SELINUX=enforcing or SELINUX=permissive string with the SELINUX=disabled one, and save the changes.
Reboot your server for the changes to take effect.
local.json when running the documentserver-configure.sh script. If you are using a WOPI connection, you need to run the script after updating ONLYOFFICE Docs:
documentserver-configure.sh --wopienabled true
Launching ONLYOFFICE Docs in a browser
Once the configuration is finished, you can enter http://localhost in your browser address bar to open the ONLYOFFICE Docs welcome page, where you will find further instructions on how to enable document examples or integrate online editors into your web application using the provided API.
To connect ONLYOFFICE Docs to ONLYOFFICE Workspace, please refer to this instruction.