Prerequisite: You will need to have an Amazon account
Log into your amazon account and launch and EC2 instance. I chose the free tier here and launched the EC2 instance will be running Amazon Linux 2. I have a detailed article on how to launch and EC2 machine here.
Make sure that we have Java JDK11 also installed on our Amazon EC2 instance. Only after that, we can proceed with the installation.
Tomcat runs on port number 8080 so make you have that open in your instance Security Group.
I used MobaXterm to SSH into my EC2 instance, but you are free to use whatever tool you like. Start and SSH session, enter your remote host IP, username and then under advance tab, load your privatKey
Make sure that you have root access on your EC2 instance and then proceed with Java JDK11 installation and check your Java version after the the installation to make sure.
amazon-linux-extras install java-openjdk11
After that, install TomCat by grabbing the link on TomCat official website
Extract and install it with the line bellow
tar -xvzf apache-tomcat-9.0.65.tar.gz
cd to Tomcat and run ll to see the content. From the content cd to the bin folder and from there you will be able to start your tomcat server with ./startup or shut it down with the ./shutdown command
Form there you will be able to access your tomcat server with your instance IP fronted by port 8080, which is the default for Tomcat
Happy install TomCatUp!