Skip to content

Self-hosted draw.io for Diagrams

Introduction

The Diagrams plugin does not ship draw.io — it loads it. The editor runs in an iframe served by draw.io, and the read-only viewer fetches its stencils, shapes and math typesetting from draw.io as well. By default both point at the public https://embed.diagrams.net, which means the user's browser needs internet access (the Easy8 server itself does not).

Installations with restricted or no internet access can run the official draw.io container inside their own network and point Easy8 at it with a single environment variable. Nothing else changes, and no draw.io files are shipped with or stored in Easy8.

Configuration

EASY_DRAWIO_URL=https://drawio.internal.example.com
  • Unset (the default) → the public draw.io is used, exactly as before. Existing installations need no action.
  • Set → both the editor and the viewer load everything from that address, and every draw.io cloud integration (Google Drive, OneDrive, GitHub, GitLab, telemetry, PlantUML, converters) is switched off, so nothing leaves the network.

The address must be reachable from the user's browser, not from the Easy8 server. A value that only resolves inside the Docker network (http://drawio:8080) will not work — publish the container under a hostname the browser can reach, ideally over HTTPS if Easy8 itself runs on HTTPS.

Restart the application after changing the variable.

Running the container

The official image is jgraph/drawio (source). It serves the whole draw.io application at the root path on port 8080 (8443 for HTTPS).

Quick check on a workstation:

docker run --rm -p 8080:8080 jgraph/drawio

As a compose service alongside Easy8:

services:
  drawio:
    image: jgraph/drawio
    restart: always
    ports:
      - "8080:8080"

Then set EASY_DRAWIO_URL to the public address of that service and restart app and sidekiq.

Upgrading draw.io is a matter of pulling a newer image — Easy8 is not involved.

What the setting covers

Loaded from
Editor iframe <EASY_DRAWIO_URL>/?embed=1&…
Stencils, shapes, styles, images, templates, resources, mxGraph assets <EASY_DRAWIO_URL>/…
MathJax used to render LaTeX inside diagrams <EASY_DRAWIO_URL>/math4/es5
Google Drive / OneDrive / GitHub / GitLab / telemetry / converters disabled

Diagram data itself is always stored in Easy8 (diagrams table plus a PNG attachment) and is never sent to draw.io — that is true with or without this setting.

Verifying

  1. Open a diagram and check the browser's network tab: every request should go to Easy8 or to EASY_DRAWIO_URL, and none to diagrams.net or draw.io.
  2. Edit and save a diagram, then reopen it — the change must survive the round-trip.
  3. Open a diagram preview (the modal from the diagram list, or a wiki include_diagram macro) and confirm it renders.
  • plugins/diagrams/lib/diagrams.rb — resolves the address and the viewer globals.
  • plugins/diagrams/README.md — provenance of the vendored viewer bundle and how to refresh it.