13

I have an AWS EC2 running linux redhad. Is there a way to install the latest Chrome v59 on it so that I can run it in headless mode just like PhantomJS? All the resources I can find in google are about how to install it in ubuntu which has a UI. My Linux doesn't have a UI.

Thanks

Lee Le
  • 337
  • 1
  • 4
  • 10
  • This might help: https://www.linkedin.com/pulse/using-yum-install-google-chrome-aws-linux-ami-konstantinos-demiris along with this: https://forums.aws.amazon.com/thread.jspa?threadID=229187 – R Brill Jul 07 '17 at 10:42
  • Bearing in mind the `rpm --import` command and option may need to be run as root – R Brill Jul 07 '17 at 11:08

3 Answers3

5

this question is kinda old, but someone may find the answer useful.

these commands install headless chrome in ubuntu:

apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
hicolor-icon-theme \
libcanberra-gtk* \
libgl1-mesa-dri \
libgl1-mesa-glx \
libpango1.0-0 \
libpulse0 \
libv4l-0 \
fonts-symbola \
--no-install-recommends \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
&& apt-get update && apt-get install -y \
google-chrome-stable \
--no-install-recommends \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /var/lib/apt/lists/*

set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSL "https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb" -o /tmp/google-talkplugin-amd64.deb \
&& dpkg -i /tmp/google-talkplugin-amd64.deb
ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb

hope this helps someone

JulioCT
  • 1,057
  • 8
  • 7
1

You might want to take a look at projects like chromeless or puppeteer which both offer a feature-rich API as well as documentation on running on most hosting providers.

Alternatively, if you're looking for something custom-built for this then I run a SaaS called browserless that attacks the problem directly.

In any case, hope that helps

browserless
  • 2,090
  • 16
  • 16
-15

Follow these steps for install chrome in linux machine,

  1. Download .rpm file from Chrome official website. click here for download chrome , download.rpm file.
  2. Double click on .rpm file and install.