There is not a lot of doc or posts about making an headless renderer with webgl support. Here are few of my findings
I tried things on Heroku, but I was not able to make anything work.
Next, I tried EC2 t2.micro, only to find out that OpenGL needs a graphic card to execute (sure, there are things like mesa that I didn't tried, but it looked like I needed to build Chrome and I didn't want to go that way).
The only easy solution that I found was AWS EC2 GPU Instances. They are pretty much overpriced for what I'm trying to acheive, but it worked. You need to use an AMI that support the Nvidia GRID thing. eg https://aws.amazon.com/marketplace/pp/B00FYCDDTE and its CentOS.
Slimer need Firefox and Firefox need shared libraries that we need to install (we will use a custom repo). And you need to start X because OpenGL uses the X thing. Xvfb was not needed finally.
Anyways, here's the commands I used.
sudo yum update
# https://github.com/nodesource/distributions
curl -sL https://rpm.nodesource.com/setup | sudo bash -
sudo yum install -y nodejs
# http://ithubinfo.blogspot.ca/2013/11/how-to-install-and-configure-xvfb-in.html
sudo yum install -y xorg-x11-server-Xvfb
wget http://download.slimerjs.org/releases/0.9.6/slimerjs-0.9.6-linux-x86_64.tar.bz2
tar xjf slimerjs-0.9.6-linux-x86_64.tar.bz2
# https://lambda-linux.io/blog/2015/01/28/announcing-firefox-browser-support-for-amazon-linux/
curl -X GET -o RPM-GPG-KEY-lambda-epll https://lambda-linux.io/RPM-GPG-KEY-lambda-epll
sudo rpm --import RPM-GPG-KEY-lambda-epll
curl -X GET -o epll-release-2015.03-1.1.ll1.noarch.rpm https://lambda-linux.io/epll-release-2015.03-1.1.ll1.noarch.rpm
sudo yum -y install epll-release-2015.03-1.1.ll1.noarch.rpm
sudo yum -y --enablerepo=epll install firefox-compat
# http://stackoverflow.com/a/21524859/808657
sudo /usr/bin/X :0 &
export DISPLAY=:0.0
Then I created these 3 files that I used to test. They may work, or not... but it gives the idea.
If you go with Ubuntu, I found these commands that may work.
sudo apt-get update
# http://docs.slimerjs.org/current/installation.html#requirements
sudo apt-get install -y libc6 libstdc++6 libgcc1 libgtk2.0-0 libasound2 libxrender1
# may not be needed
sudo apt-get install -y xvfb
# http://slimerjs.org/download.html
wget http://download.slimerjs.org/releases/0.9.6/slimerjs-0.9.6-linux-x86_64.tar.bz2
tar xjf slimerjs-0.9.6-linux-x86_64.tar.bz2
# https://github.com/nodesource/distributions
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install -y nodejs