Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arthur-e/3839809 to your computer and use it in GitHub Desktop.
Save arthur-e/3839809 to your computer and use it in GitHub Desktop.
Install bleeding edge TileMill, Node.js, and Mapnik
# Clear out any old ppa's that might conflict
sudo rm /etc/apt/sources.list.d/*mapnik*
sudo rm /etc/apt/sources.list.d/*developmentseed*
sudo rm /etc/apt/sources.list.d/*chris-lea*
# Add new ppa's
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js
echo 'yes' | sudo apt-add-repository ppa:mapnik/nightly-trunk
# Update
sudo apt-get -y update
sudo apt-get -y upgrade
# Install nodejs latest and a few tilemill deps
sudo apt-get install -y nodejs nodejs-dev npm git build-essential libgtk2.0-dev libwebkitgtk-dev
# Now, either install mapnik latest from packages
# Or see file below for installing mapnik from source
# and skip this line
sudo apt-get install -y libmapnik-dev mapnik-utils
# Set up PostgreSQL/PostGIS
# POSTGRES_VERSION=9.1 # You may need to change this
# POSTGIS_VERSION="1.5.3" # You may need to change this
# sudo apt-get install -y postgresql postgresql-server-dev-$POSTGRES_VERSION postgresql-$POSTGRES_VERSION-postgis
# sudo su postgres
# We lost variables, reset them
# POSTGRES_VERSION=9.1 # You may need to change this
# POSTGIS_VERSION="1.5" # You may need to change this
# createuser <your user> # Yes to super
# createdb template_postgis
# createlang -d template_postgis plpgsql # you may not need this
# POSTGIS_PATH=`pg_config --sharedir`/contrib/postgis-$POSTGIS_VERSION
# psql -d template_postgis -f $POSTGIS_PATH/postgis.sql
# psql -d template_postgis -f $POSTGIS_PATH/spatial_ref_sys.sql
# exit
# Install from package manager (or, build it from source below)
sudo add-apt-repository ppa:developmentseed/mapbox
sudo apt-get update
sudo apt-get install tilemill
# OR
# Build TileMill
cd /usr/local/
sudo git clone https://github.com/mapbox/tilemill.git
cd tilemill
sudo npm install
# If you are running a desktop server then just boot using all the defaults
./index.js # should open a window automatically, but you can also view at http://localhost:20009
# If you are running a headless server then the easiest thing to do
# to get a visual look at the running application is to tunnel using ssh.
# Do this from your local machine:
TILEMILL_HOST=<remote-ip>
ssh -CA ubuntu@${TILEMILL_HOST} -L 20009:localhost:20009 -L 20008:localhost:20008
# If you are using AWS then you can also pass `-i your.pem`
# then on the remove machine do
./index.js --server=true
# Now TileMill is available on your local machine at http:://localhost:20009
# Or, install proj4 latest and then mapnik from source:
# wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip
# We use trunk instead for better threading support
# svn co http://svn.osgeo.org/metacrs/proj/trunk/proj proj-trunk # at the time pre-release 4.8.0
# cd proj-trunk/nad
# unzip -o ../../proj-datumgrid-1.5.zip
# cd ../
# ./configure
# make
# make install
# Grab boost PPA for recent enough version
sudo add-apt-repository ppa:mapnik/boost
sudo apt-get update
sudo apt-get install -y libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev
# Mapnik dev deps
sudo apt-get install -y g++ cpp \
libicu-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-python-dev libboost-regex-dev \
libboost-system-dev libboost-thread-dev \
python-dev libxml2 libxml2-dev \
libfreetype6 libfreetype6-dev \
libjpeg-dev \
libltdl7 libltdl-dev \
libpng-dev \
libproj-dev \
libgeotiff-dev libtiff-dev libtiffxx0c2 \
libcairo2 libcairo2-dev python-cairo python-cairo-dev \
libcairomm-1.0-1 libcairomm-1.0-dev \
ttf-unifont ttf-dejavu ttf-dejavu-core ttf-dejavu-extra \
git build-essential python-nose clang
# The following are also required but should have been installed already,
# likely are installed, and anyway if they AREN'T
# then this isn't the way to do; refer to install-tilemill-latest.sh
# sudo apt-get install -y libgdal1-dev python-gdal \
# postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-postgis \
# libsqlite3-dev
# Mapnik sources
cd /usr/local
sudo git clone http://github.com/mapnik/mapnik
cd mapnik
sudo ./configure CXX=clang++ --prefix=/usr/local/mapnik
sudo make && sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment