Operations 5 min read

Quick Guide: Secure Linux Server Setup with JDK, Tomcat & Docker

This step‑by‑step tutorial shows how to enable security groups, configure firewall ports, install the BT panel or use the command line to set up a Linux server, then install JDK, Tomcat, and Docker CE with all required commands and configurations.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Quick Guide: Secure Linux Server Setup with JDK, Tomcat & Docker

Enable Security Group

Open the required ports (e.g., 80/tcp, 8080/tcp) in the cloud console, obtain the public IP address, change the root password, and reboot the instance if this is the first login.

Install BT Panel (optional GUI)

Installation

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

Press y to accept the default prompts.

Configure Firewall (firewalld)

# Check service status
systemctl status firewalld

# Start, restart, stop
service firewalld start
service firewalld restart
service firewalld stop

# List all rules
firewall-cmd --list-all

# Open port 80 permanently
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld.service

Install JDK

Remove existing OpenJDK packages

rpm -qa | grep java
yum -y remove java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
# ... other versions ...

Install downloaded JDK RPM

rpm -ivh jdk-11.0.8_linux-x64_bin.rpm
java -version

Install Tomcat

tar -zxvf apache-tomcat-9.0.37.tar.gz
cd apache-tomcat-9.0.37
# Start Tomcat, e.g., ./bin/startup.sh

Install Docker CE

Prepare environment

yum -y install gcc gcc-c++

Remove previous Docker packages

yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine

Add Alibaba Cloud mirror repository and install Docker

yum -y install yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce docker-ce-cli containerd.io

Start Docker and verify

systemctl start docker
ps -ef | grep docker
Docker start screenshot
Docker start screenshot
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxJDKTomcatServer SetupSecurity Group
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.