How to add Tomcat as Service Linux Machine: In this tutorial, we will see how to make tomcat server as a service in Linux machine.

Tomcat is the most used server for deploying Java applications. Tomcat can be installed as service using the installer in windows machine but in Linux machine, it’s not simple as windows machines

To set up Tomcat server, you need to install JRE First

  • Install  JRE on the Linux machine and setup the environment variables to make sure that your JRE is installed execute the command java -version in Terminal
  • If JRE is configured correctly then you will be seeing the version of your installed JRE

How to Install Tomcat:

  • After unzip go to the bin folder and try to execute the command below

  • To see tomcat is working fine & stop the server

Now actual service creation procedure will start

  • Login as root into Linux machine with sudo -i or su -i
  • Type the below command
  • Create a file in folder using command vi /etc/init.d/tomcat.service

then paste the below code

  • Change TOMCAT_USER value with respective user
  • change TOMCAT_HOME Tomcat Directory according to your path location

Save the file by type SHIFT + ; and wq  and Enter

type below command to update service

then type below command to enable in it to start at boot time

to start, stop, restart use below commands

Thank You

Also Read: Creating Topic Zookeeper/Kafka Server

How to add Tomcat as Service Linux Machine

Leave a Reply

Your email address will not be published. Required fields are marked *