Running a Java-based web application on Linux often means working with Apache Tomcat. Whether you are hosting a business application, a customer portal, or a Java website, Tomcat acts as the engine that keeps everything running smoothly.
But there are times when applications stop responding, configuration changes are made, memory usage becomes high, or updates need to be applied. In such situations, restarting the Tomcat service becomes an important administrative task.
The good part is that restarting Tomcat on Linux is simple once you know the right way. In this guide, you will learn how to properly restart the Tomcat service, verify that it is running successfully, and troubleshoot issues using logs.
Also Read: How to Set Up FTP on Linux?
Prerequisites Before Restarting Tomcat
Before proceeding, make sure you have:
- SSH access to the Linux server
- Root or sudo privileges
- Tomcat is installed on the server
- Basic Linux command knowledge
Also Read: How to Change Root Password in Linux?
Process to Restart Tomcat on a Linux VPS
To restart Tomcat on a Linux VPS, follow these steps given below:
➔ First, log in to your Linux server using SSH.
➔ After logging in, navigate to the Tomcat bin directory:
| cd /usr/local/tomcat9/bin/ |
*Note: The Tomcat installation directory may differ depending on your VPS or server configuration.
★ Small Tip
If you are unsure about the Tomcat installation path, you can locate it using:
find / -name startup.sh 2>/dev/null
This command searches the server for the Tomcat startup script.
➔ Once you are inside the directory, verify that the startup scripts are available.
You can check using this command:
| ls |
You should see files like:
- startup.sh
- shutdown.sh
- catalina.sh
➔ It’s time to start or restart the Tomcat service. There are two common methods to restart Tomcat on Linux.
Option 1: Restart Tomcat Using systemd (Recommended)
The systemctl method is cleaner, more stable, and commonly used on modern Linux distributions such as:
- Ubuntu
- CentOS
- AlmaLinux
- Rocky Linux
It automatically manages the Tomcat process in the background and helps during server boot.
➔ If Tomcat is configured as a system service, use:
| sudo systemctl restart tomcat |
➔ You can also start the service using:
| sudo systemctl start tomcat |
Option 2: Manual Tomcat Startup
Some custom VPS setups or manually installed Tomcat environments may not use systemd services. In such cases, startup and shutdown scripts are used directly.
Use this Command:
| sh startup.sh |
OR
| ./startup.sh |
If Tomcat is already running, stop it first:
| sh shutdown.sh |
Then start it again
★ Small Tip
Always stop Tomcat properly before restarting manually. This helps avoid:
- Port conflicts
- Duplicate Java processes
- Memory-related issues
➔ After restarting, verify that Tomcat has started successfully.
If started manually, look for the message:
| Tomcat started. |
If using systemd, check the service status:
| sudo systemctl status tomcat |
➔ Now open your web browser and access your application using:
http://<yourserver-ip>:8080
This is because, even if the service appears active in the terminal, verifying through the browser ensures that:
- Tomcat is listening on the correct port
- Applications are loading properly
- Network access is working correctly
★ Important Tip
If the website does not open:
- Check firewall settings
- Verify port 8080 is open
- Confirm Tomcat is running
- Ensure no other service is using the same port
➔ Now, for troubleshooting or confirmation, it is important to check the Tomcat logs. For this, navigate to the logs directory by using:
| cd /usr/local/tomcat9/logs/ |
➔ Then monitor the log file using:
| tail -f catalina.out |
Also Read: How to Kill a Process in Linux?
Common Issues While Restarting Tomcat
Here are a few common problems administrators face:
| Issue | Possible Cause |
| Port already in use | Another service is using port 8080 |
| Permission denied | Missing sudo privileges |
| Tomcat not starting | Java is not installed properly |
| Application not loading | Deployment issue or broken WAR file |
| High memory usage | Insufficient RAM allocation |
Also Read: How to Rename a Folder in Linux?
Conclusion
Restarting the Tomcat service on Linux is an essential server management task for maintaining application performance and stability. Whether you are using the modern systemctl method or manual startup scripts, understanding the proper process helps avoid downtime and troubleshooting headaches.
By following the steps in this guide, you can safely restart Tomcat, verify that it is running successfully, and quickly diagnose issues using logs as needed. Regular monitoring and proper service management also help keep your Java applications running smoothly on your Linux server.
