I want to get chrome to work headless with selenium on an ubuntu server so that I can run tests against it.
here's the commands I ran to set up chrome headless using xvfb.
Am I missing anything?
apt-get update && apt-get upgrade
apt-get install -y libxss1 libappindicator1 libindicator7 unzip
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
sudo apt-get install -y xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11
wget -N http://chromedriver.storage.googleapis.com/2.24/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod 755 chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
sudo apt-get install -y python-pip libosmesa6
sudo apt-get update && sudo apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic xvfb x11-apps imagemagick firefox google-chrome-stable
pip install pyvirtualdisplay selenium
sudo apt-get install firefox -y
useradd -m jenkins-user
mkdir /home/jenkins-user/log
chown jenkins-user:root /home/jenkins-user/log
sudo apt-get install -y default-jdk
apt-get install -y git
iptables -N SELENIUM
iptables -A INPUT -p tcp --dport 4444 -j SELENIUM
iptables -A SELENIUM -p tcp --dport 4444 -s 127.0.0.1 -j ACCEPT
iptables -A SELENIUM -p tcp --dport 4444 -j DROP
apt-get install jq
google-chrome --headless
. We are succesfully running selenium/cucumberjs tests in a custom Docker image that doesn't include it, only Chrome, Java, and Node. – Jeroen