How to Install Apache Tomcat 10 on openSUSE 15
If you’re running openSUSE 15 and need a lightweight Java servlet container, Tomcat 10 is your go‑to. I’ve spent the last month juggling multiple projects that required a clean Tomcat install on a fresh SLE 15 workstation, and this guide will cut through the fluff.
1. Make sure you’re using the right repository
openSUSE ships with the official packages in its main repo, but Tomcat 10 is only available in the community channel. Before anything else, enable that channel if it isn’t already:
sudo zypper ar -cfp 90 https://download.opensuse.org/repositories/Server:/Apache:Tomcat/openSUSE_Leap_15.5 Server-APACHE-TOMCAT
Without the community repo, zypper will keep looking in the main channel and never find Tomcat 10, leaving you stuck with an older version.
2. Install Java first
Tomcat needs a JDK or at least a JRE. I always prefer OpenJDK 17 on openSUSE because it’s the LTS that plays nicely with Tomcat 10.
sudo zypper install java-17-openjdk-devel
If you’re on an older SLE 15 system, make sure java-11-openjdk isn’t lurking in your environment—it can bite you later when you start the server.
3. Grab Tomcat 10
Now that the repo is set and Java is ready, install Tomcat:
sudo zypper install apache-tomcat-10
The package pulls the whole bundle: bin, conf, webapps, etc., into /opt/apache-tomcat-10. If you run into a “missing dependency” error, double‑check that the repo line above is correct and try sudo zypper refresh.
4. Set up environment variables
Tomcat expects $CATALINA_HOME to point to its root. Add this to your ~/.bashrc (or /etc/profile.d/tomcat.sh for system‑wide):
export CATALINA_HOME=/opt/apache-tomcat-10
Reload:
source ~/.bashrc
Some scripts, like the startup script in /usr/bin/tomcat, rely on this variable. Without it, Tomcat will try to look for a directory that doesn’t exist and fail silently.
5. Start Tomcat as a service
The package installs a systemd unit file: tomcat10.service. Enable and start it:
sudo systemctl enable --now tomcat10
Check status:
systemctl status tomcat10
You should see “active (running)”. Open a browser to http://localhost:8080 and you’ll get the Tomcat welcome page.
6. Common hiccups I’ve seen
- Port conflicts – If another service is on 8080, edit /opt/apache-tomcat-10/conf/server.xml and change to something else, like 9090. Then restart the unit.
- Java version mismatch – The Tomcat unit sets JAVA_HOME=/usr/lib/jvm/java-17-openjdk/. If you installed a different JDK, update that line or create a symlink at /usr/lib/jvm/default-java.
- SELinux/AppArmor restrictions – openSUSE’s AppArmor profile for Tomcat can block access to your webapps. Disable the profile temporarily with sudo aa-complain /etc/apparmor.d/usr.sbin.tomcat if you run into “Permission denied” errors.
7. Tweaking performance (optional)
If you’re deploying a heavy Java app, tweak the JVM flags in /opt/apache-tomcat-10/bin/setenv.sh. A typical line:
export JAVA_OPTS="-Xms512m -Xmx2g"
Save and restart Tomcat. That’s all the tuning I usually need to get a production‑grade service up on openSUSE 15.
That’s it—Tomcat 10 running, ready for your WARs or Spring Boot apps. Drop me a comment if you hit snags; I’ll be happy to help (or just vent about those stubborn driver updates). Enjoy the Java playground!