Write-up of how I build GeoServer from sources and deployed it to a locally installed Tomcat on my ThinkStation P320 Tower machine running Ubuntu 20.04 (January 2026)
In late January 2026 I built GeoServer v2.28 from sources and deployed it to a local Apache Tomcat v9 servlet container on a Ubuntu 20.04 machine.
The main steps were:
- configuring the right version of javac to compile GeoServer with
- installing the right version of Maven
- installing (and troubleshooting) the installation of Tomcat
The guides I used were:
- initial, top-level
ChatGPT discussion
outlining all steps (also archived
here
).
It should be noted that, using this guide – and after manually upgrading Maven – I was able
to compile Geoserver from sources, including all extensions using this incantation (as given in the guide):
$ mvn clean install -P allExtensions -DskipTests
If memory serves the tests were executing sort of nicely (with some warnings) but, in the end, I decided to skip them
as they were taking far too long.
-
Guide on how to (manually) download and install Maven on Ubuntu
. Also archived
here
. The reason this was necessary is that the version of GeoServer I wanted
to install (v2.28) required a higher version of Maven than
was available in the official Ubuntu repository for Ubuntu 20.04.
If memory serves the former was 3.9 whereas the latter 3.6
-
Guide on how to manually install Apache Tomcat 9 on Ubuntu 20.04
. Also archived
here
. I followed this particular guide except only (if memory serves) changing
the suggested installation location from: /opt/tomcat to:
~/software (a decision I've come to regret, not for any particular
technical reason but solely for the fact that the alternative location
I chose feels weird and is not normative).
It should also be noted that even though I configured the Uncomplicated Firewall
with an additional rule, as suggested by the guide:
$ sudo ufw allow 8080
… this step (Step 6
in the guide) was moot in my case as I don't have the
ufw firewall enabled on my system upon startup.
Following the instructions on the above guides resulted in Tomcat being unable to start properly
so I then entered into a
discussion with DeepSeek
on how to troubleshoot the problem I was facing. This discussion is also
archived
here.
In the end, I ended up modifying the systemd/system Tomcat Unit file from:
the version originally suggested by guide #3
… to:
this.
The above changes also account for the fact that I'm using a different version of Java than the one suggested in guide #3.
A (sadly cropped) visual comparison (produced by Meld) is given in
this screenshot.
After properly configuring the systemd Tomcat Unit file
(/etc/systemd/system/tomcat.service), I was able to interact with Tomcat
and examine its logs using such commands as the following:
$ sudo systemctl start tomcat.service # or just 'tomcat' in lieu of 'tomcat.service'
$ sudo systemctl stop tomcat.service
$ sudo systemctl status tomcat.service
$ sudo systemctl reload-or-restart tomcat.service
$ journalctl -f -u tomcat.service
In the end, I realized that for my purposes (local development / testing) I had gone to unnecessary
lengths and suffered unnecessary pain to install Tomcat as a system-wide service with its own
dedicated (pseudo-) user (plus it was less ergonomic to modify configuration files I had
to sudo and such). It is indeed infinetely simpler (with zero complications) to just
download the Tomcat tarball from the official site, explode it somewhere under my
home directory and control it via the /bin/startup.sh and /bin/shutdown.sh
scripts.
So after writing these lines my plan is to remove the tomcat user from my system and its
associated systemd Unit files.
Regardless of the method of installing Tomcat I also encountered a CORS issue with
GeoServer in the troubleshooting of which I lost a day and entered into a couple of
discussions with two AIs (that went nowhere due to a red-herring) before finally realizing
what it was all about and what was necessary. This record is kept in the repo of noteworthy
AI discussions.