Environment Setup
8/29/25About 2 minInstallation and Deployment
Version Requirements
| Component | Version Requirement |
|---|---|
| JDK | 1.8 |
| Docker | 24.0.7+ |
| Docker Compose | 2.20.2+ |
1. JDK 1.8
1.1 Download JDK
https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
Download jdk-8u401-linux-x64.tar.gz and upload it to the server.
1.2 Extract to the deployment directory
sudo mkdir -p /opt/java
sudo tar zxvf jdk-8u201-linux-x64.tar.gz -C /opt/java/
sudo mv /opt/java/jdk1.8.0_201 /opt/java/openjdk1.3 Configure environment variables
Open /etc/profile and add the following content at the end of the file:
export JAVA_HOME=/opt/java/openjdk
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.${JAVA_HOME}/bin:$PATH1.4 Read and run commands from /etc/profile in the current bash environment
source /etc/profile1.5 Test whether deployment succeeded
java -version2. Docker
2.1 Download the Docker offline package
https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz
Download docker-24.0.7.tgz and upload it to the server.
2.2 Write the docker.service file
sudo vi docker.serviceFill in the following content and save the file.
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target2.3 Write the install.sh file
sudo vi install.shFill in the following content and save the file.
#!/bin/sh
echo 'Extracting the tar package...'
tar -xvf $1
echo 'Moving the docker directory to /usr/bin...'
cp docker/* /usr/bin/
echo 'Moving docker.service to /etc/systemd/system/...'
cp docker.service /etc/systemd/system/
echo 'Adding file permissions...'
chmod +x /etc/systemd/system/docker.service
echo 'Reloading configuration files...'
systemctl daemon-reload
echo 'Starting docker...'
systemctl start docker
echo 'Enabling startup on boot...'
systemctl enable docker.service
echo 'Docker installed successfully...'
docker -v2.4 Start docker
chmod +x install.sh
./install.sh docker-24.0.7.tgz2.5 Test whether deployment succeeded
sudo docker -v
# Normal output: Docker version 24.0.7, build afdd53b3. Docker Compose
3.1 Download the Docker Compose offline package
https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-linux-x86_64
Download docker-compose-linux-x86_64 and upload it to the server.
3.2 Deploy
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose3.3 Test whether deployment succeeded
sudo docker-compose -v
# Normal output: Docker Compose version v2.20.2