DEV Community

Cover image for Installing Tomcat on an EC2 instance
Souleymane. Tiendrebeogo for AWS Community Builders

Posted on • Edited on

24 2

Installing Tomcat on an EC2 instance

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.

SecurityGroup

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

MobaXterm

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
java -version
Enter fullscreen mode Exit fullscreen mode

Java

After that, install TomCat by grabbing the link on TomCat official website

wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.65/bin/apache-tomcat-9.0.65.tar.gz
Enter fullscreen mode Exit fullscreen mode

Image description

Extract and install it with the line bellow

tar -xvzf apache-tomcat-9.0.65.tar.gz
Enter fullscreen mode Exit fullscreen mode

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

cd apache-tomcat-9.0.65
ll
cd bin
ll
./shutdown
./startup

Enter fullscreen mode Exit fullscreen mode

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

TomCatHome

Happy install TomCatUp!

Billboard image

Use Playwright to test. Use Playwright to monitor.

Join Vercel, CrowdStrike, and thousands of other teams that run end-to-end monitors on Checkly's programmable monitoring platform.

Get started now!

Top comments (0)

Using Athena data connectors to  visualize DynamoDB data with AWS QuickSight cover image

Using Athena data connectors to visualize DynamoDB data with AWS QuickSight

Learn how to visualize DynamoDB data in AWS QuickSight using Athena data connectors, Athena Engine Version 2, and Lambda permissions without creating custom resources or duplicating data.

Read full post

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay