You can use the apt-get
command to install Tomcat on Ubuntu. Here are the steps:
- Update the package list by running the following command: sudo apt-get update
- Install the Tomcat package using the following command: sudo apt-get install tomcat9
- Start the Tomcat service by running the following command: sudo systemctl start tomcat9
- Enable the Tomcat service to start automatically at boot time by running the following command: sudo systemctl enable tomcat9
- Test the installation by accessing the Tomcat welcome page in a web browser: http://localhost:8080
- To stop tomcat service you can use the following command: sudo systemctl stop tomcat9
- To check the status of tomcat service you can use the following command: sudo systemctl status tomcat9
Using the apt-get command to install Tomcat will automatically handle dependencies and configure the service to start automatically at boot time.
You can also check the logs in /var/log/tomcat9/catalina.out for any errors.
Leave a Reply