Steps to setup selenium with xvfb on debian
apt-get install xvfb
wget http://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar
sudo echo "deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" >> /etc/apt/sources.list
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
sudo apt-get update
sudo apt-get install firefox-mozilla-build
xvfb-run java -jar selenium-server-standalone-2.43.1.jar
Setting up firewall to accept only local connections by selenium:
sudo iptables -A INPUT -p tcp --dport 4444 -s 127.0.0.1 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 4444 -j DROP