In recent months, I have been asked numerous times for my notes on how to set up an open source GIS server. Although I meticulously document all my installations, my notes were admittedly scattered between several documents that focus on setting up Ubuntu Server, Geoserver, PostGIS, or integrating QGIS. I wrote this tutorial in an effort to unify my documentation and help newbies get started with the exciting world of open source GIS software!
This blog series has four parts. Part 1 documents the process of installing Ubuntu Server in a virtualization environment (VirtualBox), part 2 is on spatial relational database management system (Postgresql/PostGIS) installation/configuration, part 3 is on Geoserver installation/configuration, and lastly, part 4 shows how everything can be integrated into QGIS.
CAUTION: The following tutorial is not meant to help set up a secure server for production purposes. The tutorial documents the creation of a basic server setup for testing/educational purposes. Proceed at your own risk.
Hardware and Software Requirements
Since VirtualBox and QGIS both run on Linux, Windows, and Mac, there are no specific OS requirements, though VirtualBox installation procedures may vary between OS. In terms of hardware, at least 100GB of HDD space and 2-4GB of RAM to spare is required. For example, this tutorial was developed on a laptop with a 500GB HDD and 8GB of ram. The VM will function with 2GB of RAM, but more RAM is always helpful.
Ubuntu Server on VirtualBox
There are several free virtualization environments on the market and each performs the same essential functions — create and run virtual machines with specific hardware configurations. For this tutorial, I am using Oracle’s VirtualBox, which runs on Windows, Linux, Mac OS, and Solaris hosts. Its GUI is easy to use and the documentation is very well written and thorough. Version 5.0.40 was used on an Ubuntu Desktop host machine.
1) Download and install VirtualBox here.
2) Download the current LTS version of Ubuntu Server here. At the time of writing this tutorial, the current LTS version was 16.04.3.
3) Run Virtualbox on the host machine and then click the “New” button.
4) Enter a name for you virtual machine (e.g. GIS Server), type and version. Click next.
5) Give your VM at least 2GB of ram and click next.
6) Select “Create a virtual hard disk now” and click Create. For the hard disk file type, select VDI. Click next.
7) As the the next screen explains, the VM can expand dynamically or be a fixed size. It is entirely up to you, as either setting will work for the present purposes. If you are building this VM for a production environment, it is advisable to read the documentation more thoroughly to make an informed decision.
8) In the next dialog box, name your VM file and select the size of the VM on disk. For the present example, a dynamically allocated hard disk file was used with a maximum size of 8GB, which should be more than enough for the present purposes.
9) Click create and the new VM will appear in the list.
10) Click on the new VM in the list and click on Settings (or right-click and click on settings). The Settings dialog box will appear.
11) Under the Storage section, virtually insert the Ubuntu Server ISO file into the IDE Secondary Master.
12) Under the Network section, change Adapter 1 to a “Bridged Adapter”. This will give your VM a local IP address on the same subnet as your host machine. Press OK and the settings dialog box will close. You are now ready to fire up your VM and install Ubuntu Server.
13) Select the GIS Server in the VM list and click “Start” (or right-click > Start). Select English to continue (or another language of your choice).
14) Select “Install Ubuntu Server” on the next screen.
15) Select your preferred language for the installation.
16) Select country, territory or area.
17) Click no for keyboard config, unless you have something other than a standard US keyboard.
18) Select your country of origin for keyboard layout.
19) Select keyboard layout
20) The installation process will detect hardware and install software.
21) Enter the hostname for your system.
22) Enter a name.
23) Enter a name for your user account.
24) Choose a password. Confirm password after selecting “continue”.
25) No need to encrypt your drive as this is a test machine. Click no to continue.
26) The installation process will continue…
27) If the detected timezone is correct, select Yes. Otherwise, select the correct time zone.
28) Partition disk using “Select Guided – use entire disk”. This will use the entire VM hard drive. Advanced users may see advantages to setting up a custom partition.
29) On this screen the virtual hard drive will be listed. Press enter to select this drive and to continue.
30) Confirm partition settings and if correct, select yes.
31) Leave blank and select continue, unless you require a proxy setting to access the outside world.
32) Select either “No automatic updates” or “Install security updates automatically”.
33) Don’t install anything other than the standard system utilities. You will install software manually in the next tutorial.
34) Let the software installation complete.
35) Select yes to install GRUB boot loader.
36) Click Continue to reboot and complete installation.
37) Once rebooted, you will be promoted for your username and password. Enter both and press enter.
38) At this point, your Ubuntu Server is installed and ready to go!
In Part 2, we will install the relational database management system (PostgreSQL) and spatial extension (Postgis). We will also connect the database to QGIS and show you some of the basic functionality (e.g. loading layers, querying data, saving styles to DB, etc.).