Script to Install PhantomJS on a Linux CentOS Machine

phantomJSWhat is PhantomJS? PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. Download v1.9 Get started.

The project homepage for PhantomJS can be found here:

In this post we will show you how to download and install this package onto a Linux / CentOS machine.  Most of the time this code would be included as a source code library within your websites code package.  However there may be times that this code should be installed at the server level.

For this post we will use the 64Bit version of the code and download it from BitBucket.  We will also use the 1.9.8 version of the software.  Newer versions may be available so be sure to check the projects download pages.

# Install in the /usr/bin directory
cd /usr/bin

# Get the package from BitBucket
# Un Zip it
tar jxf phantomjs-1.9.8-linux-x86_64.tar.bz2

# Create a handy link to the installed version
ln -s phantomjs-1.9.8-linux-x86_64/bin phantomjs

# All done for now...

Well, that’s about it.  The script is pretty straight forward.  Let us know how you are using PhantomJS in your projects.

Posted in , and tagged , , , .