How to Organize Your Teamwork with ONLYOFFICE on Ubuntu 14.04

Published on November 22, 2016
Default avatar

By Tati

How to Organize Your Teamwork with ONLYOFFICE on Ubuntu 14.04

An Article from ONLYOFFICE


ONLYOFFICE is a free, open source corporate office suite developed to organize teamwork online. It’s composed of three separate servers:

  • The Document Server provides users with text, spreadsheet and presentation online editors working within a browser and allowing to co-edit documents in real time, comment and interact using the integrated chat.
  • The Community Server offers a complete set of tools for document, project, customer relation and email correspondence management.
  • The Mail Server is used to create mailboxes using your own domain name.

Because ONLYOFFICE has many moving parts and dependencies, in this tutorial we’ll simplify the installation process and avoid dependency errors by deploying ONLYOFFICE using Docker containers.


To follow this tutorial, you will need:

Note: The size requirement for an ONLYOFFICE server depends on which ONLYOFFICE components you will use, how many users will work in the web office, and the quantity of documents and mail you plan to store. 8 GB is recommended for all three servers.

This tutorial will assume some familiarity with SSL, a security technology, and Docker, an open-source project that automates the deployment of applications inside software containers. If you’re not familiar with SSL, this SSL tutorial has explanations to get you started. If you’re new to Docker, you can read this Docker tutorial for an introduction.

Step 1 — Setting Up Security

Before installing ONLYOFFICE, we will first make sure access to it will be secured using SSL. To do this, we’ll need a private key (.key) and an SSL certificate (.crt).

If we use CA-certified certificates, these files are provided by the certificate authority. When using self-signed certificates we need to generate these files ourselves. The simplest and least expensive way to do it, especially if you have a small team, is to use a self-signed certificate. That’s what we’ll do here.

The ONLYOFFICE configuration directory will be /app/onlyoffice/CommunityServer/data. So first, we’ll create a directory to store our self-signed certificates here.

  1. sudo mkdir -p /app/onlyoffice/CommunityServer/data/certs

Move into the created directory.

  1. cd /app/onlyoffice/CommunityServer/data/certs

Next, create the server private key.

  1. sudo openssl genrsa -out onlyoffice.key 2048

Create the certificate signing request (CSR).

  1. sudo openssl req -new -key onlyoffice.key -out onlyoffice.csr

Here, you will be asked a few questions about your server to add the appropriate information to the certificate.

Once you fill out this information, sign the certificate using the private key and CSR.

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

Strengthen the server security by generating stronger DHE parameters, a temporary 2048-bit Diffie-Hellman key.

  1. sudo openssl dhparam -out dhparam.pem 2048

Now we have a SSL certificate valid for 365 days, and we can move on to installing ONLYOFFICE itself.

Step 2 — Installing ONLYOFFICE

First, we’ll create an ONLYOFFICE network to allow a group of containers we need to communicate over it and isolate them from others. Use bridge as a --driver to manage the network.

  1. sudo docker network create --driver bridge onlyoffice

The commands we’ll use to start the ONLYOFFICE servers are pretty long, so let’s look at one and break it down. First, run this command to install the ONLYOFFICE Document Server:

  1. sudo docker run --net onlyoffice -i -t -d --restart=always \
  2. --name onlyoffice-document-server \
  3. -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
  4. -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice onlyoffice/documentserver

Here, we launched an ONLYOFFICE container using docker run --net onlyoffice, which means it automatically connects to the onlyoffice bridge network we just created. -d means the container starts detached; -i keeps STDIN open (even when the container is detached); -t allocates a TTY. To make Docker automatically restart the containers on reboot, we specified the --restart=always parameter.

As a rule, all the data inside the Docker containers is stored in specially-designated directories called data volumes. Each ONLYOFFICE component has data volumes in particular directories. The Document server uses /var/log/onlyoffice for logs and /var/www/onlyoffice/Data for certificates.

To get access to these data volumes from outside the container, we mounted the volumes by specifying the -v option. Note that the necessary directories will be created automatically, but we will still need to grant the access rights to them once our web office is installed.

Now, install the ONLYOFFICE Mail Server, specifying your domain:

  1. sudo docker run --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server \
  2. -p 25:25 -p 143:143 -p 587:587 \
  3. -v /app/onlyoffice/MailServer/data:/var/vmail \
  4. -v /app/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver \
  5. -v /app/onlyoffice/MailServer/logs:/var/log \
  6. -v /app/onlyoffice/MailServer/mysql:/var/lib/mysql \
  7. -h example.com \
  8. onlyoffice/mailserver

This is very similar to the previous command with the addition of the -p flag to expose a few ports (25 for SMTP, 143 for IMAP, and 587 for SMA). The data volumes for the Mail Server are:

  • /var/log for logs
  • /var/lib/mysql for MySQL database data
  • /var/vmail for mail storage
  • /etc/pki/tls/mailserver for certificates

Install the last of the three ONLYOFFICE servers: the Community Server.

  1. sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-community-server \
  2. -p 80:80 -p 5222:5222 -p 443:443 \
  3. -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \
  4. -v /app/onlyoffice/CommunityServer/mysql:/var/lib/mysql \
  5. -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \
  6. -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/DocumentServerData \
  7. -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server \
  8. -e MAIL_SERVER_DB_HOST=onlyoffice-mail-server \
  9. onlyoffice/communityserver

The Community Server opens ports 80 for HTTP, 443 for HTTPS, and 5222 for XMPP-compatible instant messaging client (for ONLYOFFICE Talk). The data volumes are:

  • /var/log/onlyoffice for logs
  • /var/www/onlyoffice/Data for data
  • /var/lib/mysql for MySQL database data

Finally, grant access to the created folders:

  1. sudo chmod -R 755 /app/

Now, all three servers are installed and we can finish setting them up.

Step 3 — Running and Configuring ONLYOFFICE

To access your new web office, visit https://example.com in your favorite browser.

Note that if you’re using a certificate that isn’t signed by one of your browser’s trusted CAs, you may get a warning. You can find a setting to access the page anyway, usually under an option labeled Advanced or something similar.

You will be directed to your web office. The initialization process will start. It might take some time, but once the initialization process finished, the welcome page will open. This will allow us to start the ONLYOFFICE initial configuration.

Installing ONLYOFFICE on Ubuntu 14.04

First, select and confirm the password and specify the email address you will use to access your office the next time.

Choose the language for your web office interface. When working in ONLYOFFICE, you will be able to change the language for all the users or for your own account only.

Set the time zone for your area. It’s particularly important for notifications and making the calendar work correctly.

Finally click the Continue button to complete the ONLYOFFICE configuration.

The email activation message will be sent to the specified email. Follow the link provided in this message to complete the email activation procedure. There’s one last step, which is to finish configuring the mail server.

Step 4 — Configuring ONLYOFFICE Mail Server

To finish configuring mail, click the Mail Server icon on the welcome page.

Installing ONLYOFFICE on Ubuntu 14.04

Click the Set up domain link.

Installing ONLYOFFICE on Ubuntu 14.04

Click the Set up the first domain link, enter your domain name in the corresponding field, and click the Next button.

Installing ONLYOFFICE on Ubuntu 14.04

Then, create all the required records using the information provided in the ONLYOFFICE wizard instructions:

Installing ONLYOFFICE on Ubuntu 14.04

On DigitalOcean, you can do this in the control panel in the Networking section, under Domains.

Once all the records are created, click the OK button in your browser. The added domain will be shown on the domain list page.

Your web office is fully set up!


You’ve set up the ONLYOFFICE Document, Community, and Mail Servers. Now you can invite your teammates to start working. You can:

  • Open, create and edit text documents, spreadsheets, and presentations — and co-edit them in real time with your team
  • Create a project with milestones, tasks and subtasks and coordinate it using a Gantt chart
  • Create a customer database, track potential sales storing all the necessary data in one place
  • Connect and manage one or several email accounts
  • Create an internal network with blogs, forums, bookmarks, polls, etc. for your community
  • Organize your timetable and invite your teammates or any Internet users to events

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us

About the authors
Default avatar


Default avatar

staff technical writer

hi! i write do.co/docs now, but i used to be the senior tech editor publishing tutorials here in the community.

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

I’m excited to uncover this page. I need to thank you for your time for this, particularly fantastic read!! I definitely really liked every part of it and I also have you saved to fav to look at new information in your site.

This comment has been deleted

    After copying and pasting from the tutorial into the shell I found that the server was rejecting HTTPS connections but was working on HTTP. Any help would be greatly appreciated. Also, on the first line is that word supposed to read “It’ss”?

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Join the Tech Talk
    Success! Thank you! Please check your email for further details.

    Please complete your information!

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel