I\'m on EC2 instance. So there is no GUI.
$pip install selenium $sudo apt-get install firefox xvfb
Then I do this:
$Xvfb :1
If you use Maven, you can use xvfb-maven-plugin to start xvfb before tests, run them using related DISPLAY environment variable, and stop xvfb after all.
DISPLAY