Installing GeoServer into Tomcat on Ubuntu

This page will discuss the basic steps for installing GeoServer into Tomcat on Ubuntu. For more detailed instructions, please see the Windows GeoServer instructions which are very similar.

Standard installation

Note

Boundless Server requires Java 1.8 and Tomcat 8.

Note

See the System administration section for installation and administration help.

  1. If you have an existing OpenGeo Suite, Boundless Suite, Boundless Server, or GeoServer install, backup your configuration (specifically your GeoServer data directory) and data.

  2. Uninstall any old versions.

  3. Install Java 1.8. (Boundless Server requires Java 1.8)

    Note

    We recommend downloading from Oracle.

    Note

    See Setting the JVM for dealing with multiple versions of java on your machine.

  4. Install Tomcat 8 and ensure Tomcat is using the Java 8 runtime.

    Note

    We suggest setting up Tomcat as a service. This guide from Ubuntu may be helpful here.

  5. Setup Tomcat with the following options:

    • -Xms256m
    • -Xmx756m (or higher)
    • -XX:SoftRefLRUPolicyMSPerMB=36000
    • -XX:-UsePerfData
    • -Dorg.geotools.referencing.forceXY=true
    • -Dorg.geotoools.render.lite.scale.unitCompensation=true
  6. If you don’t have an existing GeoServer data directory, you can use the boundless-server-data-dir.zip inside the Boundless WAR bundle BoundlessSuite-war.zip.

    Note

    A suggested location would be /var/opt/boundless/server/geoserver/data:

    mkdir -p /var/opt/boundless/server/geoserver/data
    unzip boundless-server-data-dir.zip -d /var/opt/boundless/server/geoserver/data
    
  7. Add a GeoServer context file (geoserver.xml) to $CATALINA_HOME/conf/Catalina/localhost/ with the following content:

    <Context docBase="geoserver.war">
      <!-- The location of the GeoServer configuration directory -->
      <Parameter name="GEOSERVER_DATA_DIR"
                 value="/var/opt/boundless/server/geoserver/data"
                 override="false"/>
    
      <!-- The default location of the GWC tile cache -->
      <Parameter name="GEOWEBCACHE_CACHE_DIR"
                 value="/var/opt/boundless/server/geoserver/tilecache"
                 override="false"/>
    </Context>
    

    Note

    Make sure the GEOWEBCACHE_CACHE_DIR exists, and the GEOSERVER_DATA_DIR points to your data directory location.

  8. Copy geoserver.war to $CATALINA_HOME/webapps.

  9. Start Tomcat, navigate to the GeoServer Welcome page at http://localhost:8080/geoserver and verify that the GeoServer data directory and Java version is correct.

  10. Go to the GeoWebCache main page at http://localhost:8080/geoserver/gwc and verify the Local Storage (GEOWEBCACHE_CACHE_DIR) is correct.

Binaries

Some Geoserver extensions require non-java (binary) support libraries.

GDAL

  1. Install, from the Boundless Repository, the GDAL and GDAL-java packages.

    On Red Hat:

    yum install gdal gdal-java
    

    On Ubuntu:

    apt-get install libgdal libgdal-java
    

    Note

    You can also install the gdal-mrsid package for MrSID and JP2K support.

  2. Verify the GDAL install by running gdalinfo --formats to see a long list of supported formats and gdalinfo --version to verify the version (1.11.2). Also verify that the gdal.jar file is in /usr/share/java

  3. Copy the gdal.jar from /usr/share/java into the WEB-INF/lib directory of your Geoserver web application.

  4. Copy the .jar files from the gdal directory inside the Boundless Server extensions bundle (BoundlessSuite-ext.zip - available from Boundless Connect) into the WEB-INF/lib directory of your Geoserver web application.

  5. In your Tomcat config, make sure that -Djava.library.path includes the gdal and gdal-jni libaries - /usr/lib64, /usr/lib, /usr/lib/jni.

  6. In your Tomcat config (tomcat8.conf), create a GDAL_DATA environment variable that points to /usr/share/gdal

Also see Enabling MrSID image support.

To verify that the GDAL native library extension has been installed properly:

  1. Navigate to the GeoServer web application and login using the admin credentials.

  2. Navigate to the GeoServer Detailed Status Page at http://localhost:8080/geoserver/rest/about/status.

  3. Verify that the GDAL extension is available (Enabled and Available both set to true):

    ../../../_images/gdal_rest.png

    GDAL available

    If you don’t see this exactly as displayed, the extension did not install correctly.

  4. Click Stores then Add new store.

  5. In the list of Raster Data Stores, you should see extra raster formats, such as MrSID, EHdr, and NITF.

    ../../../_images/gdal_storelinks.png

    GDAL formats in the list of raster stores

    If you don’t see these entries, the extension did not install correctly.

NetCDF-4 Output

Note

Uninstalling the NetCDF-out extension requires editing the global.xml file - see Uninstallation

  1. Install the NetCDF-output extension by copying the .jar files from the netcdf-out directory inside the Boundless Server extensions bundle (BoundlessSuite-ext.zip - available from Boundless Connect) into the WEB-INF/lib directory of your Geoserver web application.

  2. Install, from the Boundless Repository, the NetCDF package.

    On Red Hat:

    yum install netcdf
    

    On Ubuntu:

    apt-get install netcdf-bin
    
  3. Verify the NetCDF install by running ncdump to verify the version (4.3.3.1)

  4. In your Tomcat config, make sure that -Djna.library.path includes the NetCDF libaries - /usr/lib64, /usr/lib.

To verify that the NetCDF native library extension has been installed properly:

  1. Navigate to the GeoServer web application and login using the admin credentials.

  2. Navigate to the GeoServer Detailed Status Page at http://localhost:8080/geoserver/rest/about/status.

  3. Search for “NetCDF Output” on the page and verify that the binary is available.

    ../../../_images/ncdf4-status.png

    NetCDF 4 output settings