

Most CI servers have a plugin for Xvfb, or you can do it from the command line: Xvfb :99 &.

Assuming you are using a Debian server, you will not be able to install something like Firefox with apt-get, because the repositories are not present. On a Debian you install a headless browser like this: There are several tutorials on the Net that tell you how to install Xvfb, most of which are incomplete or wrong. You mentioned Ubuntu, which is a Debian derivative. Most systems will allow you to have a virtual GUI. PahntomJS is definitely an option, as it uses WebKit - the engine that is in Safari and Chrome browsers, but you would have to write your own API. GhostDriver has not been maintained for 2 years, and as such also makes for unreliable results. Personally I would avoid both of these! HtmlUnit uses a JavaScript engine that none of the current desktop browsers support, and as such the tests are not very reliable.

Another popular browser is PhantomJS, which has third-party Selenium bindings library called GhostDriver. There are headless browsers: browsers that also do not have a GUI component. What you are probably asking is: If I use Selenium to open a browser, is that browser going to work on a system with no GUI. Selenium is only a library, and as such it does not particularly care if you are running it on a system that is equipped with a GUI.
