Skip to content

ONLYOFFICE/snap-documentserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

145 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Snap for ONLYOFFICE Docs

License ONLYOFFICE Docs

✨ Overview

ONLYOFFICE Docs (Document Server) is a powerful open-source office suite for real-time document collaboration. It enables you to:

  • Create and edit documents, spreadsheets, presentations, and PDFs
  • Collaborate with multiple users simultaneously
  • Work with all popular office formats (DOCX, ODT, XLSX, ODS, CSV, PPTX, ODP, etc.)

πŸ’‘ Why Snap?

The Snap package bundles all dependencies, making installation, updates, and management seamless across Linux distributions.

πŸ› οΈ Core Editors

ONLYOFFICE Docs includes a full set of editors and tools:


πŸš€ Installation Guide

1. Ensure snapd is available

ONLYOFFICE Docs is available in the Snapcraft store. Snap packages contain all dependencies, so setup is simple.

To use Snap packages, you need snapd, a system to install and manage snaps. Most modern Linux distributions include snapd by default; you may only need to enable or install it.

If missing, install it. Example for Ubuntu/Debian:

# apt update
# apt install snapd

πŸ‘‰ For other distributions, see the official snapd installation guide

2. Install ONLYOFFICE Docs

Once snapd is ready, install ONLYOFFICE Docs with the following command:

# snap install onlyoffice-ds

The Document Server and all required dependencies are now installed.

▢️ Running ONLYOFFICE Docs

After installation, the service starts automatically.

To check service status:

# snap services onlyoffice-ds

To restart service :

# snap restart onlyoffice-ds

βš™οΈ Configuration

Running ONLYOFFICE Document Server on a different port

By default, the snap listens to port 80. If you'd like to change the HTTP port (e.g., to port 8888), run:

# snap set onlyoffice-ds onlyoffice.ds-port=8888

MySQL port configuration

By default, MySQL uses port 3306. You can also change the database port:

# snap set onlyoffice-ds onlyoffice.db-port=3307

πŸ” Running ONLYOFFICE Document Server using HTTPS

Access to ONLYOFFICE can be secured with SSL to prevent unauthorized access. While a CA-certified SSL certificate ensures trust verification through the certificate authority, self-signed certificates can offer a similar level of trust, provided each client takes additional steps to verify your website's identity. Follow the instructions below for guidance.

To secure the application via SSL, basically two things are needed:

  • Private key (.key)
  • SSL certificate (.crt)

When using CA-certified certificates, the necessary files are provided by the certificate authority. For self-signed certificates, you’ll need to generate these files yourself. If you already have CA-certified SSL certificates, you can skip the following section.

Generation of self-signed certificates

Generating self-signed SSL certificates is a straightforward three-step process.

STEP 1: Create the server private key

$ openssl genrsa -out onlyoffice.key 2048

STEP 2: Create the certificate signing request (CSR)

$ openssl req -new -key onlyoffice.key -out onlyoffice.csr

STEP 3: Sign the certificate using the private key and CSR

$ openssl x509 -req -days 365 -in onlyoffice.csr -signkey onlyoffice.key -out onlyoffice.crt

You have now generated an SSL certificate which is valid for 365 days.

If you'd like to use Example with Self-Signed Certificates, you need to allow using unauthorized storage.

Strengthening the server security

This section offers instructions to enhance your server's security. To do so, you'll need to generate stronger DHE parameters.

$ openssl dhparam -out dhparam.pem 2048

Installation of the SSL Certificates

From the four files generated above, you need to install onlyoffice.key, onlyoffice.crt and dhparam.pem on the ONLYOFFICE server. The CSR file is not required, but be sure to back it up securely in case it’s needed in the future.

The default path where the ONLYOFFICE application is configured to locate SSL certificates is /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs.

The path /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/ serves as the data storage, meaning you’ll need to copy the files into this directory.

# cp onlyoffice.key /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/
# cp onlyoffice.crt /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/
# cp dhparam.pem /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/

Then, restart ONLYOFFICE Document Server to work on SSL:

# snap restart onlyoffice-ds

You are now just one step away from having the application secured.

To revert the ONLYOFFICE Document Server to operate over HTTP, delete the files from /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs and restart the server.

# rm /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/onlyoffice.*
# rm /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/dhparam.pem
# snap restart onlyoffice-ds

Running ONLYOFFICE Document Server on a different SSL port

By default, HTTPS SSL port is 443. If you'd like to change it (e.g., to port 444), run:

# snap set onlyoffice-ds onlyoffice.ds-ssl-port=444

Allow ONLYOFFICE to use unauthorized storage

By default, the Document Server is prevented from using an unauthorized storage. To allow it, run:

# snap set onlyoffice-ds onlyoffice.use-unautorized-storage=true

Set Document Server to run on loopback interface

By default, the Document Server doesn't run on loopback interface. To set it, run:

# snap set onlyoffice-ds onlyoffice.loopback=true

πŸ”‘ JSON Web Token

  • jwt-enabled: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Document Server. Defaults to true.
  • jwt-secret: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Random string by default.
  • jwt-header: Defines the http header that will be used to send the JSON Web Token. Defaults to Authorization.

If you'd like to change the JSON Web Token parameters, run:

# snap set onlyoffice-ds onlyoffice.key=value

Allow Document Server to use WOPI protocol

By default, the Document Server is prevented from using a WOPI protocol. To allow it, run:

# snap set onlyoffice-ds onlyoffice.wopi=true

Enabling the example

By default, a test example is not enabled. You can enable it using the command:

# snap set onlyoffice-ds onlyoffice.example-enabled=true

Enabling the Admin Panel

By default, the Admin Panel is not enabled. To enable the Admin Panel, use the command:

# snap set onlyoffice-ds onlyoffice.adminpanel-enabled=true

Uninstall ONLYOFFICE Docs

To remove the snap containing ONLYOFFICE Docs, use the following command:

# snap remove onlyoffice-ds

πŸ“Œ Project links

🌍 Official Website: ONLYOFFICE Docs

πŸ’Ύ Code repository: ONLYOFFICE Docs main repo

πŸ§‘β€πŸ’» ONLYOFFICE API: Check out developer documentation

πŸ’¬ Support & Community

Need help or want to discuss ONLYOFFICE Docs? Join our community: