How to Install Java, Tomcat, MySQL, phpMyAdmin on Ubuntu 20.04 in GCP/AWS Intance

By Technical Digit

Before you deploy any Web Application on your Ubuntu Server, You have to install Java , Tomcat Server, MySql Database, phpMyAdmin etc.

First of all open Terminal on GCP Ubuntu Instance OR connect your AWS Ubuntu Instance in Putty Software through SSH.

Login as root and update

> sudo su

> apt-get update

Install JAVA (OpenJDK)

Run below command to install OpenJDK 11

> sudo apt-get install openjdk-11-jre openjdk-11-jdk


Run below command to install OpenJDK 8

> sudo apt-get install openjdk-8-jre openjdk-8-jdk

Check Java Version:

> java -version

Set Java Environment Variable

> echo “JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/” >> /etc/environment

> source /etc/environment

Check Environment Variable:

> echo $JAVA_HOME

Install Tomcat Server

> apt-get install tomcat9

Commands for start/stop Tomcat Service:

> service tomcat9 start

> service tomcat9 status

> service tomcat9 stop

> service tomcat9 restart

Now Go to http://SERVER_IP:8080/ and you will see it’s working.

Install MySQL Server

> apt-get install mysql-server

> mysql_secure_installation

Follow the instructions.

Commands for start/stop Tomcat Service:

> service mysql start

> service mysql status

> service mysql stop

> service mysql restart

Install phpMyAdmin

> apt-get install phpmyadmin

1. Choose apache2 by pressing Space and then Enter, when a popup screen appears.

2. Next, you will be asked whether to use dbconfig-common to set up the database, select Yes and hit Enter.

3. Enter password for phpMyAdmin, select OK and press Enter.

4. Confirm the same password in next screen.

5. Restart Apache Server using below command

> sudo systemctl restart apache2

6. Now go to http://SERVER_IP/phpmyadmin/ and Login.

For More Information Watch This Video: https://youtu.be/pNuNXy7M1H4

Total Views: 2605