Thursday, January 6, 2011

Install GeoServer on Amazon EC2 without leaving the browser

Learned a new trick from @waxpancake at ThinkUp, so here's how to install GeoServer on a Ubuntu Maverick 10.10 EC2 instance with out leaving the browser.

Launch an Ubuntu AMI, in this example I use ami-cef405a7, but check this page to find a suitable AMI from Canonical. 
I use a micro instance in this example, but you can use any size.
Copy the following script in the User Data textbox. The script downloads the install script from the earlier blog post and runs it.
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1

# download the install script and run it
cd /home/ubuntu
chmod 755
It should look like this:
You can tag your instance or leave it blank.
Use an existing keypair or create a new one.
Use and existing security group or create a new one. Note that port 80 and 22 need to be open for Apache and ssh respectively.
Launch the instance.

That's it! It may take a minute or three to get everything installed, configured, and running even if the console shows that the instance is running.


  1. Great tutorial!

    Would like to mention that you should visit

    http://[amazon Public DNS: info ]/geoserver/

    Username: admin
    Password: geoserver

  2. I'm surprised that you were able to get Java to install on a micro instance. Whenever I try the instance goes into a complete kernel panic. To workaround this problem I create a small instance, install Java (and geoserver while I am at it) and create an AMI. I then use that AMI to create a new micro instance.

  3. I use a Canonical AMI and install Java via a partner repo, maybe that is the difference?