- Home
- Docs
- Installation
- Community
- Linux version
- Installing ONLYOFFICE Docs on CentOS and derivatives
Installing ONLYOFFICE Docs on CentOS and derivatives
Introduction
Community Edition lets you install ONLYOFFICE Docs on your local server and integrate the online editors with the ONLYOFFICE collaboration platform or other popular systems, letting you share files, manage access rights, embed documents on a website, and edit files stored on Drive, Box, Dropbox, OneDrive, or ownCloud connected to ONLYOFFICE (see the detailed list of features). This guide shows you how to install the Linux version of ONLYOFFICE Docs Community Edition on 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;
}
sudo mv -f /etc/nginx/sites-enabled/default /etc/nginx/sites-available/default.disabled
sudo mv -f /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled
sudo systemctl is-active --quiet nginx && sudo systemctl reload nginx || sudo systemctl start nginx
Depending on how NGINX was installed, one of the first two commands may report that the file does not exist. You can safely ignore this message.
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 8083. 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 script:
bash documentserver-configure
Add a firewall exception
sudo firewall-cmd --zone=public --add-port=8083/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 script. If you are using a WOPI connection, you need to run the script after updating ONLYOFFICE Docs:
documentserver-configure --wopienabled true
Launching ONLYOFFICE Docs in a browser
Once the configuration is finished, you can enter http://localhost:8083 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.