Installing Google Chrome on Amazon Linux (EC2)

Edit: This tutorial for now works only for chrome v58. V59 and higher needs libgtk3 which is not available in the mirrors yet. Compiling gtk3 using this might be also a solution.


Google Chrome team has added an amazing feature into the lastest version — headless support. This brings an amazing oportunity to laverage usage of Amazon EC2 instances to do some automated browsing stuff without pain of using (soon obsolete) PhantomJS or Firefox with Xvfb.

Amazon Linux is not great for newbies like me. I had some troubles with installing the chrome so after some struggle I created an install script that will install it for you.

sudo touch /etc/yum.repos.d/google-chrome.repo
sudo echo -e "[google-chrome]\nname=google-chrome\nbaseurl=\$basearch\nenabled=1\ngpgcheck=1\ngpgkey=" >> /etc/yum.repos.d/google-chrome.repo
sudo touch /etc/yum.repos.d/centos.repo
sudo echo -e "[CentOS-base]\nname=CentOS-6 - Base\nmirrorlist=\ngpgcheck=1\ngpgkey=\n\n" >> /etc/yum.repos.d/centos.repo
sudo echo -e "#released updates\n[CentOS-updates]\nname=CentOS-6 - Updates\nmirrorlist=\ngpgcheck=1\ngpgkey=\n\n" >> /etc/yum.repos.d/centos.repo
sudo echo -e "#additional packages that may be useful\n[CentOS-extras]\nname=CentOS-6 - Extras\nmirrorlist=\ngpgcheck=1\ngpgkey=\n" >> /etc/yum.repos.d/centos.repo
sudo yum install -y google-chrome-stable
google-chrome-stable --version

It has nothing complicated in it. Just adding some necessary repos.

After this, you can start using headless chrome. is good place to start :)

I hope that someone will find it useful.