ObjectiveThe objective is to install Tomcat 8 server on Ubuntu 18.04 Bionic Beaver Linux
Operating System and Software Versions
- Operating System: - Ubuntu 18.04 Bionic Beaver
- Software: - Tomcat 8.5.21
RequirementsPrivileged access to your Ubuntu System as root or via
sudocommand is required.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
Install Tomcat 8 ServerThe easiest way to install Tomcat 8 on Ubuntu 18.04 is to use
taskselcommand. If you are running Ubuntu Server 18.04 the
taskselcommand is already pre-installed.
However, if you are running Ubuntu Desktop 18.04 you will need to install it before you can install Tomcat server. Open up terminal and execute:
$ sudo apt install taskselOnce ready, use
taskselcommand to install Tomcat 8 on your Ubuntu 18.04 host:
$ sudo tasksel install tomcat-serverIf successful check for an open port
sscommand to see whether Tomcat is up and running as expected:
The Tomcat 8 server on Ubuntu 18.04 will by default start after reboot. To disable and enable Tomcat 8 server to start after reboot execute:
$ ss -tln State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:5355 0.0.0.0:* LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 [::]:5355 [::]:* LISTEN 0 100 *:8080 *:* LISTEN 0 128 [::]:22 [::]:* LISTEN 0 1 [::ffff:127.0.0.1]:8005 *:*
$ sudo systemctl enable tomcat8 OR $ sudo systemctl disable tomcat8
Open firewall ports for Tomcat serverIn case you have already the
ufwfirewall the following linux command will allow TCP incoming traffic from any source to your Tomcat 8 server's port
$ sudo ufw allow from any to any port 8080 proto tcpIf you wish to make your firewall rules more strict visit our How to Open/Allow incoming firewall port guide for more information.
Test Tomcat 8 serverIt is time to perform a simple test. Given that your Tomcat 8 server can be resolved via
tomcat-ubuntuyou can now visit Tomcat's 8 main page.
Start your web browser and enter URL
$ sudo nano /etc/tomcat8/tomcat-users.xmland add the following information above the
</tomcat-users>tag to create a new user
Save the file and restart Tomcat server:
<role rolename="admin-gui"/> <role rolename="manager-gui"/> <user username="tomcat" password="pass" roles="admin-gui,manager-gui"/>
$ sudo service tomcat8 restartUse the new user credentials to access Tomcat Web Application Manager: