How to install Chrome headless on Ubuntu

You can use it on your server to render web pages to HTML or pdf.

In my case, I use it to render dynamic js pages.

First, we need to update the apt.

sudo apt update

If you don’t have wget, install it

sudo apt install wget

OK. Download the Chrome deb binary.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

The next step – install it!

sudo apt install ./google-chrome-stable_current_amd64.deb

All done.

To use it in the terminal just add this flag – --headless

google-chrome-stable --headless --dump-dom https://easy-devs.com/

Leave a Reply

Your email address will not be published. Required fields are marked *