Install GeoServer on Ubuntu Server
1) Install Java 11 runtime:
sudo apt update
sudo apt install default-jdk
Verify Java has been installed by checking its version:
java -version
Java is now installed!
2) Install Apache Tomcat
sudo apt install tomcat9 tomcat9-admin
Enable Tomcat to start at system boot:
sudo systemctl enable tomcat9
Start the service with:
sudo service tomcat9 start
Confirm the service is running with:
sudo service tomcat9 status
If the service is running ok, a line saying active will be displayed.
3) Install GeoServer
wget https://sourceforge.net/projects/geoserver/files/GeoServer/2.20.3/geoserver-2.20.3-war.zip
Stop Tomcat before unzipping the files:
sudo service tomcat9 stop
Move the downloaded file to the webapps directory:
sudo mv geoserver-2.20.3-war.zip /var/lib/tomcat9/webapps
Navigate to the webapps directory:
cd /var/lib/tomcat9/webapps
Unzip the file:
sudo unzip geoserver-2.20.3-war.zip
If unzip has not been installed, use:
sudo apt install unzip
After installing Tomcat, type:
sudo nano /etc/tomcat9/tomcat-users.xml
Add the following three lines to the xml file:
<role rolename=“admin-gui”/>
<role rolename=“manager-gui”/>
<user username=“tomcat” password=“pass” roles=“admin-gui,manager-gui”/>
Reboot (or simply restart tomcat service):
sudo reboot
Geoserver is accessible at: http://192.168.92.20:8080/geoserver (or whatever is your IP/domain)