How to Deploy GeoServer on Tomcat - Quick Professional Guide
Running GeoServer directly is easy, but running it inside Apache Tomcat gives you much better performance, security, and professional control — ideal for production projects.
Here’s a simple and complete guide to installing it properly.
π Why Use Tomcat Instead of Standalone GeoServer?
| Standalone GeoServer | GeoServer on Tomcat |
|---|---|
| Good for testing | Best for production |
| Limited SSL and security options | Easy HTTPS and scaling |
| Manual service management | Automatic, service-based management |
| Basic performance | High-performance tuning possible |
β If you serve WMS/WFS layers to real apps, always prefer Tomcat deployment.
π What You Need
| Software | Purpose | Download Link |
|---|---|---|
| Java JDK (Recommended: JDK 17) | Required to run Tomcat & GeoServer |
Download Java |
| Apache Tomcat 9 | Host the GeoServer web app |
Download Tomcat |
| GeoServer WAR file | Deployable GeoServer version |
Download Geoserver |
π Installation Steps
1. Install Java JDK
-
Download and install Java JDK 17.
-
Set Environment Variables:
-
JAVA_HOME = C:\Program Files\Java\jdk-17 -
Add to Path:
%JAVA_HOME%\bin
-
2. Install Apache Tomcat
-
Extract the Tomcat zip file to a simple location (e.g.,
D:\Tomcat9). -
Start
bin/startup.batto check if Tomcat runs (http://localhost:8080).
3. Deploy GeoServer
-
Copy
geoserver.warinto thewebappsfolder of Tomcat. -
Restart Tomcat (
startup.batas Admin). -
Tomcat will auto-extract the GeoServer application.
4. Access GeoServer
-
Open your browser:
http://localhost:8080/geoserver- Login (Default: admin / geoserver).
π§ Tomcat Tuning Tip (Important)
After the first deployment, open Tomcat's conf/web.xml and adjust sessionTimeout if needed.
Also, edit bin/setenv.bat (create if missing) and add memory tuning:
set JAVA_OPTS=-Xms512m -Xmx2048m
β This improves GeoServer performance with large spatial datasets.
Additionally, disable auto-caching inside GeoServer if you want real-time map updates.
β¨ Quick Troubleshooting
| Problem | Solution |
|---|---|
| Startup.bat closes instantly | Check JAVA_HOME and Path settings |
| 404 error after deploy | Make sure fresh WAR file used |
| Internal Server Error | Run startup.bat from Admin Command Prompt to see real error |
π― Final Summary
| Step | Action |
|---|---|
| 1 | Install JDK and set JAVA_HOME |
| 2 | Install Tomcat |
| 3 | Deploy GeoServer.war |
| 4 | Tune memory and test server |
π’ Closing Tip
"Always match Java and Tomcat versions correctly. For Tomcat 9, JDK 8, 11, or 17 are best. Use simple folder paths to avoid permission issues."
Muhammad Sohail
Comments
Leave a Reply