Go to the PhantomJS download page
Download the Linux binary, it will be something like this phantomjs-1.9.2-linux-x86_64.tar.bz2
- un-bzip and untar the archive file.
bunzip2 phantomjs-1.9.2-linux-x86_64.tar.bz2 tar -xvf phantomjs-1.9.2-linux-x86_64.tar
- move the file into the /opt directory
sudo mv phantomjs-1.9.2-linux-x86_64 /opt/phantomjs
If you don’t have a
~/bindirectory in your path, now would be a good time to make one and include it in your path.
- Link the phantomjs executable to a link in your
cd ~/bin ln -s /opt/phantomjs/bin/phantomjs phantomjs
- You’re done! Test out the phantomjs command with