In this tutorial, we will be looking at installing OnlyOffice on Ubuntu 16.04. For those of you who don’t know, OnlyOffice is a web app that provides online office suite, email, document management, project management and CRM system all in one place.
OnlyOffice is formerly known as Teamlab Office. Some features are as follows:
- It combines the best of MS office and Google Docs.
- Offers more collaborative capabilities than Google Docs, fast real-time co-editing
- More feature-rich than MS Office Online
- It offers better support for MS Office formats than any other open source office suite and is fully compatible with OpenDocument formats.
- Integration with Box, OneDrive, Dropbox, Google Apps, Twitter, Facebook, LinkedIn.
- Mail and calendar integration, mail autoreply, address book.
OnlyOffice offers all necessary tools for business: mail, document management, CRM, projects, calendar, mail, corporate social network with blogs, forums, and wiki, chat.
Open Source Community Edition vs Enterprise Edition
Just like WordPress, you can sign up OnlyOffice’s service or you can set up a self-hosted OnlyOffice server which means you install OnlyOffice on your own server. The open source community edition is for free whereas the enterprise edition lifetime license costs $1500 per one server.
The free edition includes a full-featured web office and the following features.
- Online Document Editors
- Document Management
For more comparison between free and enterprise edition, visit this page. It’s recommend that you use the official OnlyOffice Docker containers to install the free OnlyOffice Community Edition.
The installation process is simple, so let’s get started.
Step 1: Install Docker on Ubuntu 16.04
Docker is included in Ubuntu software repository. However, to ensure that we have the latest version, we will have to install it from Docker’s APT repository. Fire up a terminal window (CTRL+ALT+T), then edit
sources.list file with your favourite text editor such as nano.
sudo nano /etc/apt/sources.list
Scroll down to the bottom of this file and add the following line.
deb https://apt.dockerproject.org/repo ubuntu-xenial main
CTRL+O to save the file, then
CTRL+X to exit. Next, run the following command to import the Docker GPG key to Ubuntu 16.04 system so that APT can verify package integrity during installation.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
And because this repository uses HTTPS connection, which I recommend all software repositories should be using, we also need to install
sudo apt-get install apt-transport-https ca-certificates
Now finally, update the package index on your Ubuntu 16.04 system and install
sudo apt update sudo apt install docker-engine
Check Docker version.
Docker version 1.12.0, build 8eab29e
Once installed, the Docker daemon should be automatically started. You can check it with:
systemctl status docker
If it’s not running, then start the daemon with this command:
sudo systemctl start docker
And enable auto-start with system boot:
sudo systemctl enable docker
Step 2: Install OnlyOffice Community Edition Using Docker
OnlyOffice Community edition comprises of the following 3 components.
- OnlyOffice community server
- OnlyOffice document server
- OnlyOffice mail server
To install all of them, follow these steps.
First create a Docker network called
sudo docker network create --driver bridge onlyoffice
Then install OnlyOffice document server with the below command. Simply copy and paste.
sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-document-server \ -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ onlyoffice/documentserver
Next, execute the following command to install OnlyOffice mail server. Replace with red-colored text with you own domain name.
sudo docker run --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server \ -p 25:25 -p 143:143 -p 587:587 \ -v /app/onlyoffice/MailServer/data:/var/vmail \ -v /app/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver \ -v /app/onlyoffice/MailServer/logs:/var/log \ -v /app/onlyoffice/MailServer/mysql:/var/lib/mysql \ -h onlyoffice.yourdomain.com \ onlyoffice/mailserver
After that, issue this command to install OnlyOffice community server.
sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-community-server \ -p 80:80 -p 5222:5222 -p 443:443 \ -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/mysql:/var/lib/mysql \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/DocumentServerData \ -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server \ -e MAIL_SERVER_DB_HOST=onlyoffice-mail-server \ onlyoffice/communityserver
Step 3: Adding Swap Space
OnlyOffice consumes a whole lot of RAM. If your physical memory is small, you can easily add a swap file to increase the available RAM to use. First we use
fallocate command to create a file. For example, create a file named
swapfile with 4G capacity in root file system:
sudo fallocate -l 4G /swapfile
Then make sure only root can read and write to it.
sudo chmod 600 /swapfile
Format it to swap:
sudo mkswap /swapfile
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes) no label, UUID=h32b3e10-0779-4865-9ea0-6e2af8f3kea9
Enable the swap file
sudo swapon /swapfile
Step 4: Finish the Installation in Browser
Once it’s done, enter your server’s IP address in the browser address bar,
OnlyOffice will start initializing as shown below.
In the next page, enter a password and email address to secure the OnlyOffice Portal. This is the admin account. You will need to confirm this email address.
After clicking the continue button, you will be redirected to the home page of your OnlyOffice server. Clicking the big documents icon will take you to the online office suite where you can create and edit word documents, spreadsheets, presentation files. The 5 small icon at the bottom will respectively take you to project management, CRM, Mail, People and community page.
To use a domain name instead of IP address, go to settings (gear icon) > DNS settings. And enter your domain name.
Once you click the Save button, you can access your OnlyOffice server via your domain name, provided that a correct A record is set in DNS.
Editing Word Documents Online
Managing Customer Relationships with CRM
Building an email server with OnlyOffice is really a piece of cake! No longer have to worry about esoteric configurations of Postfix and dovecot.