I am trying to get phantomjs (a headless browser) working on my server...

Bottom line is i'm not having any luck.

The answer in the FAQ for phantomjs is to run it with Xvfb: http://code.google.com/p/phantomjs/issues/detail?id=163

However i have NO IDEA what this means or how to use it. I installed it with yum instal... that's as far as I got.

I even emailed the developer and asked him for explanation, he quickly responded by creating an issue in the bug tracker to add it to the documentation...


I would greatly appreciate if someone could contribute and write instructions on how to do this.

However, I am in a crunch and need it today so I would be more than willing to pay someone $100 to take care of this for me. Please text if interested - 1.941.993.0586

1 Answer 1


xvfb let's you run your browser headless. xvfb -screen screennum WxHxD. This option creates screen screennum and sets its width, height, and depth to W, H, and D respectively. By default, only screen 0 exists and has the dimensions 1280x1024x12.

#yum install xvfb xfonts-base xfonts-75dpi xfonts-100dpi
# Xvfb :1 -screen 0 1024x768x24 &

Let's say you want run firefox in a headless mode with google.com in url

# DISPLAY=:1 firefox http://google.com &

Aparently you will see nothing on your screen but 'top' will show firefox running, i.e. in a headless mode

Check this link http://code.google.com/p/phantomjs/wiki/XvfbSetup

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .