Skip to content

Install

The fastest way to install chartjs2img is the one-liner shown in the Quick start — a curl-pipes-bash script that downloads the right binary for your platform and drops it on your PATH. This page covers every other option: the install landing page, GitHub Releases, Docker, and building from source.

No browser needed for the default engine

chartjs2img renders on the skia engine by default — a native Skia canvas that runs in-process with no browser. Installing the binary is all you need. Chrome / Chromium is only required if you opt into the browser engine (--engine browser); see Chromium / Chrome detection below.

The install landing page

The install scripts are served from a dedicated page:

https://bin.ideamans.com/oss/chartjs2img

TIP

The landing page itself is in Japanese, but the install commands are universal and work as-is on any locale.

It publishes the latest versioned script for each platform:

PlatformCommand
macOS / Linuxcurl -fsSL https://bin.ideamans.com/install/chartjs2img.sh | bash
Windows (PowerShell)irm https://bin.ideamans.com/install/chartjs2img.ps1 | iex

Default install locations:

  • Linux / macOS — a system-wide directory (usually /usr/local/bin). Override per-user with --install-dir $HOME/bin:
    sh
    curl -fsSL https://bin.ideamans.com/install/chartjs2img.sh | bash -s -- --install-dir "$HOME/bin"
  • Windows (admin)C:\Program Files\chartjs2img\chartjs2img.exe
  • Windows (standard user)%USERPROFILE%\bin\chartjs2img.exe

If you installed to a custom directory, make sure it's on your PATH.

GitHub Releases (manual download)

Every tagged release publishes prebuilt archives. Download, extract, and move the binary yourself.

https://github.com/ideamans/chartjs2img/releases/latest

PlatformAsset
Linux x64chartjs2img_<version>_linux_amd64.tar.gz
Linux ARM64chartjs2img_<version>_linux_arm64.tar.gz
macOS (Apple Silicon)chartjs2img_<version>_darwin_arm64.tar.gz
Windows x64chartjs2img_<version>_windows_amd64.zip

Intel Mac (darwin-amd64): no prebuilt binary is published (Apple Silicon is the supported Mac target). On an Intel Mac, run via bun, Docker, or npm, or build from source.

Linux / macOS

sh
VERSION=0.6.0
OS=linux       # or darwin
ARCH=amd64     # or arm64

curl -fsSL -o chartjs2img.tar.gz \
  "https://github.com/ideamans/chartjs2img/releases/download/v${VERSION}/chartjs2img_${VERSION}_${OS}_${ARCH}.tar.gz"

tar -xzf chartjs2img.tar.gz
sudo mv chartjs2img /usr/local/bin/

Windows (PowerShell)

powershell
$Version = "0.6.0"
$Url = "https://github.com/ideamans/chartjs2img/releases/download/v$Version/chartjs2img_${Version}_windows_amd64.zip"

Invoke-WebRequest $Url -OutFile chartjs2img.zip
Expand-Archive chartjs2img.zip -DestinationPath .
# move chartjs2img.exe somewhere on your PATH, e.g. %USERPROFILE%\bin

Docker (HTTP server only)

If you want to run chartjs2img as a long-running HTTP service, pull or build the Docker image — it ships with both rendering engines (skia-canvas for the default skia engine, and Chromium for the browser engine) plus Noto Sans CJK fonts baked in, so there's no first-run download and Japanese / Chinese / Korean labels render correctly on either engine.

See HTTP server → Docker for build, run, and docker-compose recipes.

Build from source

chartjs2img is built with Bun. Install Bun, then:

sh
git clone https://github.com/ideamans/chartjs2img
cd chartjs2img
bun install
bun run build        # produces ./chartjs2img in the repo root

Or run without compiling — handy for hacking on the CLI itself:

sh
bun run src/index.ts render -i chart.json -o chart.png

skia in a compiled binary

The bun run build binary embeds the default skia engine, so it renders every built-in chart type with no external dependencies. One caveat: inside the compiled binary, euler / venn charts fall back to an ellipse renderer (minor overlap-fill artifacts) due to a skia-canvas quirk under the compiled runtime. bun run, the npm library, and the HTTP server render venn / euler at full fidelity; so does the browser engine.

Chromium / Chrome detection

Only the browser engine needs Chromium

Everything in this section applies only when you use the browser engine (--engine browser). The default skia engine renders in-process and never touches Chrome / Chromium — you can skip this entirely if you only use skia.

On first use of the browser engine, chartjs2img searches for a browser in this order:

  1. CHROMIUM_PATH environment variable — explicit override wins.
  2. Puppeteer browser cache~/.cache/puppeteer/, etc.
  3. System-installed Chrome/Chromium/Applications/Google Chrome.app, /usr/bin/google-chrome, etc.
  4. Auto-downloadChrome for Testing is pulled into the user cache dir (no sudo required).

Auto-download is available for macOS (x64/arm64), Windows (x64), and Linux (x64).

Linux ARM64 (manual Chromium required)

Chrome for Testing does not publish linux-arm64 builds. Install Chromium yourself and point CHROMIUM_PATH at it:

sh
# Debian / Ubuntu
sudo apt install chromium-browser   # or `chromium`

export CHROMIUM_PATH=/usr/bin/chromium-browser
chartjs2img render -i chart.json -o chart.png

You can also set it in the systemd unit / Docker run environment to persist it.

Upgrade

Re-run the one-liner from the Quick start, or pull the latest asset from Releases. The script is idempotent — it replaces the existing binary in place.

Uninstall

Delete the binary from wherever it was installed (/usr/local/bin/chartjs2img, $HOME/bin/chartjs2img, or the Windows install directory). That's the only file the installer writes. At runtime chartjs2img may also cache a downloaded Chromium under ~/Library/Caches/ms-playwright/ (macOS), ~/.cache/ms-playwright/ (Linux), or %LOCALAPPDATA%\ms-playwright\ (Windows); delete that directory to reclaim the ~250 MB.

Edit this pageLast updated: