How to Take WebSite Screenshots from Linux Terminal? / Linux / How to Take WebSite Screenshots from Linux Terminal?

If you need to take a screenshot of websites via the Linux server console, you can use the screenshoter ( This is an HTTP service in a Docker container based on Google Puppeteer.

In the simplest case, you can start the screenshoter container like this:

# docker pull mingalevme/screenshoter
# docker run -d --restart always -p 8080:8080 --name screenshoter mingalevme/screenshoter

Now, to take a screenshot of the website, it is enough to call the API via HTTP. Just run the curl command in the console:

# curl "http://localhost:8080/screenshot?url=" > ~/sitescreen.png

As a result, a site screenshot will be saved to a ~/sitescreen.png file.

You can specify the screen resolution of the client for which you want to create a screenshot:

# curl "http://localhost:8080/screenshot?url=" > ~/1920-1080-poweradm_screen.png

This screenshot solution can be used in any webhook-based monitoring system.

screenshoter - docket container to get site screenshot from bash terminal on linux

You can run the Screenshoter container with Nginx to proxy the connection. To do this, use the following docker-compose.yml:

version: "3.1"


  image: mingalevme/screenshoter
  restart: always

  image: nginx:alpine
   - "80:80"
   - ./screenshoter.nginx.conf:/etc/nginx/conf.d/default.conf
   - "/var/log/nginx:/var/log/nginx"
   - "/var/cache/nginx:/var/cache/nginx"
   - "/dev/null:/var/cache/screenshoter"
   - screenshoter-app

So you can get screenshots of the site directly from a browser.

The screenshoter has quite a few options. You can specify user-agent, cookies, device-scale-factor, transparency, etc. The full list of screenshoter options is available on the project’s GitHub page.

Leave a Reply

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