Install Spire.Cloud.Office for Linux on CentOS via Docker

Spire.Cloud.Office is a HTML5-based document editor that allows users to view and edit Word and Excel documents in a web browser. After installing it on your server, you'll be able to embed the editor in your own web application. This article will show you how to install Spire.Cloud.Office for Linux on CentOS 7 via Docker.

Step 1. Pull Spire.Cloud.Office Docker Image

Run the script docker pull eiceblue/centos7:spire to pull the image of Spire.Cloud.Office from the docker repository.

Install Spire.Cloud.Office for Linux on CentOS via Docker

Step 2. Create a Docker Container

Create a docker container named "spirecloud" (or whatever name you like) by executing the script docker run -itd --privileged --name spirecloud -e IP_ADDR="xxx.xxx.xxx.xxx" -p 3000:3000 -p 8000:8000 -p 8050:8050 eiceblue/centos7:spire /usr/sbin/init. Don't forget to specify the IP address and the ports according to your usage scenario.

Install Spire.Cloud.Office for Linux on CentOS via Docker

Step 3. Copy License to CentOS

Here, we use WinSCP to copy files from Windows to the root of CentOS system.

1) Log in to WinSCP.

Install Spire.Cloud.Office for Linux on CentOS via Docker

2) Copy the license file to the /root/license/ directory.

Install Spire.Cloud.Office for Linux on CentOS via Docker

Step 4. Copy License from Root to Docker

Run the script docker cp /root/license/license.elic.xml spirecloud:/opt/spire/spire.cloud/service/ConverterService/bin/license to copy the license file from root to the docker container.

Install Spire.Cloud.Office for Linux on CentOS via Docker

Step 5. Bind License

Execute the following commands successively to bind the license.

- docker exec -it spirecloud /bin/bash
- cd opt/spire
- sh binding_license.sh

Install Spire.Cloud.Office for Linux on CentOS via Docker

Now that you've successfully installed Spire.Cloud.Office for Linux on CentOS, you can visit our example on port 3000, and embed the document editor in your HTML page using JavaScript.

Install Spire.Cloud.Office for Linux on CentOS via Docker