CubeDrive Installation   ->   Install 3rd-party software

Install 3rd-party software

Java, MySQL, MongoDB, Tomcat, Nginx 3rd-party softwares are required to run CubeDrive.

1: JDK

Download and install JDK 8 from
install java-8
     sudo apt install openjdk-8-jdk
install supervisor
    sudo apt install supervisor
install wkhtmltopdf
    sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb    

Please set JAVA_HOME in the Linux system. For example, add the following line in the file: /etc/profile.d/

export JAVA_HOME
export PATH 
save file and quit editor, run below commands:
chmod 755 /etc/profile.d/
source /etc/profile

2: Database Server

MySQL is used as CubeDrive database server. In general, MySQL can be pre-installed during install Linux system. If not, please go to:

You can download and install MySQL (version 5.7.*) in your Linux server.

docker run -d --name mysql-5.7 -v /data/mysql-5.7:/var/lib/mysql -p -p -e MYSQL_ROOT_PASSWORD="mysql-abc-2022" --restart=always mysql:5.7

Create Schema

After MySQL is installed successfully, please generate a schema for the CubeDrive:

     drop database cubedrive;
     create database cubedrive DEFAULT CHARACTER SET utf8;
     use cubedrive;    

Create table

Email us to get the MySQL tables and inject the SQL file into the above MySQL schema:

cat Database-cubedrive.sql | /usr/bin/mysql -u root --password=root -h localhost cubedrive  

Insert default data

Download the SQL files and inject the SQL file into the above MySQL schema:

cat Database-initialData.sql | /usr/bin/mysql -u root --password=root -h localhost cubedrive

(Option) Update cnf file

Added below variables in /etc/my.cnf to set utf8 - support multiple language


If you have any issues when installing mysql database, please search Google online. CubeDrive does not have special requirements for the MySQL database server.

3: MongoDB

Download MongoDB from and select version 3.4.24

Install MongoDB
docker run -d --name  mongo-3.4 -v /data/mongo-3.4:/data/db -p -p -e MONGO_INITDB_ROOT_USERNAME="root" -e MONGO_INITDB_ROOT_PASSWORD="mongo-abc-2022"  --restart=always mongo:3.4.24 –auth

Start MongoDB:
mongo client: 
docker exec -it mongo-3.4 mongo
use cubedrive

4: Tomcat

Download and install Tomcat 8 in your Linux system. Tomcat also can be pre-installed during install Linux system. Please check it first
For example, you can put it under:

Update server.xml

Edit file: /opt/3rd-parts/cubedrive-server-1/conf/server.xml


<Connector executor="tomcatThreadPool" port="8109" protocol="org.apache.coyote.http11.Http11AprProtocol" connectionTimeout="600000" redirectPort="8443" enableLookups="false" disableUploadTimeout="false" connectionUploadTimeout="36000000" URIEncoding="UTF-8"/>
<Connector executor="tomcatThreadPool" port="9109" protocol="org.apache.coyote.ajp.AjpAprProtocol" connectionTimeout="300000" keepAliveTimeout="300000" redirectPort="8443" acceptorThreadCount="5" acceptCount="500"/>


<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

Enlarge Tomcat memory

The default tomcat server memory is 256m which is not enough for the system. We need enlarge tomcat memory, go to:


Edit file ( by adding the following line after line: #!/bin/sh

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms2548m -Xmx2548m -Xmn768m -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseFastAccessorMethods -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/fzhuang/dump/sheet-server-1 -Dxr.load.xml-reader=org.ccil.cowan.tagsoup.Parser -XX:PermSize=192m -XX:MaxPermSize=192m"

Note: this line should be inserted at the top line of file:

(Option) Add SSH

If you need add SSL, please get a ssl license first and update Tomcat

>$ cd /<tomcat_HOME>/conf
>$ vi server.xml
<Connector port="80"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
<Connector port="443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="/etc/tomcat6/keystore" keystorePass="changeit" />

5: Nginx

Nginx is a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. For more detail, please visit:

Install redis-server

docker run --name redis-6 -d -v /data/redis-6:/data -p -p --restart=always redis:6-alpine --appendonly yes --requirepass "Nohw6uag"

6: URL

Please also have a domain name which can be binded with your Linux IP address. For example:

7: SSL

Please also have a SSL certificate for Nginx ready.

The SSL/TLS protocol uses a pair of keys – one private, one public – to authenticate, secure and manage secure connections. These keys are a linked pair of text files and are created together as a pair when you create your Certificate Signing Request (CSR).

SSL works by making one key of the pair (the public key) known to the outside world, while the other (the private key) remains a secret only you know.