If you're looking to have your own ONLYOFFICE server, what better way than to deploy it as a Docker container. Jack Wallen shows you how.
One thing to know about Linux is that it's an incredibly flexible platform. If there's something you need done, it can do it. And the advent of containers has made that obviously clear. The one-two combination of Linux and Docker makes deploying applications on your network exceedingly simple.
I'm going to walk you through the process of deploying a Docker container for the ONLYOFFICE server. With this particular container, you can have your very own cloud-based office suite. By deploying the ONLYOFFICE server in this manner, you don't have to worry about picking up all of the dependencies for a full-blown installation. It's all there ready to go in a single Docker container.
The system requirements for this particular container are a bit higher than your average container. Why? Because this is an entire cloud-based office suite, so you're looking at the following requirements:
- RAM: 2 GB or more
- Swap file: at least 2 GB
- HDD: at least 2 GB of free space
- Supported distributions: 64-bit Red Hat, CentOS or other compatible distribution with kernel version 3.8 or later, 64-bit Debian, Ubuntu or other compatible distribution with kernel version 3.8 or later
- Docker: version 1.4.1. or later
I will be installing on Ubuntu 16.10 with the assumption you have Docker already running and are capable of deploying containers. I will also assume you have access to a user that is a member of the docker group (so you don't have to deploy using sudo).
Deploying the container
There are three different ways to deploy this container. I'll demonstrate all three. Open up your terminal window and prepare to type.
If you can spare port 80, the standard deployment command is:
docker run -i -t -d -p 80:80 onlyoffice/communityserver
Of course, you'll want to connect the container to a volume, so data is saved on the host directory (and not within the container). To do that, create a directory on the Docker server with the command:
sudo mkdir -p /var/www/onlyoffice/Data
Once that directory is created, the command to deploy the container (attached to the newly created directory), would be:
sudo docker run -i -t -d -p 80:80 -v /opt/onlyoffice/Data:/var/www/onlyoffice/Data onlyoffice/communityserver
If port 80 isn't available, you can run it on a different port like so:
sudo docker run -i -t -d -p 8080:80 -v /opt/onlyoffice/Data:/var/www/onlyoffice/Data onlyoffice/communityserver
Note: The above command will direct host port 8080 to container port 80.
Should you need to prevent unauthorized access to the data on your ONLYOFFICE container, you can deploy it using SSL. Do note that this will require the creation of the following two SSL keys:
The command to deploy ONLYOFFICE with SSL is:
docker run -i -t -d -p 80:80 -p 443:443 -v /opt/onlyoffice/Data:/var/www/onlyoffice/Data onlyoffice/communityserver
Connecting to ONLYOFFICE
Once the container is deployed, you are ready to point a browser to the IP address of your Docker server. Open up a browser to http://SERVER_IP (Where SERVER_IP is the IP address or domain of your server) and you will be greeted by the ONLYOFFICE Portal (Figure A).
In order to register the portal, you must type an email address, enter/verify a password, and click to accept the EULA. After you've filled out the information, click Continue and you're ready to use ONLYOFFICE.
Congratulations, you now have a full-blown ONLYOFFICE server up and running, thanks to Linux and Docker. Deploying such a powerful tool couldn't possibly be any easier.
- How to share data between a Docker container and host (TechRepublic)
- How to deploy and use a MySQL Docker container (TechRepublic)
- How to automatically update Docker containers with Watchtower (TechRepublic)
- How to create and manage Docker networks (TechRepublic)
- How to export and import containers with Docker (TechRepublic)
- Docker strives for profit with new Enterprise Edition (ZDNet)