Use a self-hosted JavaScript viewer in Confluence Server to export to HTML

When you export a diagram to HTML in draw.io for Confluence server, it uses JavaScript hosted on the diagrams.net servers to display the draw.io diagram(s).

Instead of using this script over the internet, you can download the JavaScript file from the GitHub repository and host it yourself.

  1. Copy the viewer.min.js file from the diagrams.net Github repository at https://github.com/jgraph/drawio/tree/master/src/main/webapp/js.
  2. Store that file in a location where all of your Confluence users can access it, either online or within your company’s intranet, and copy its URL.
  3. As an administrator, click on the gear in the Confluence menu, then select General configuration to go to your instance’s administration area.
  4. In the left panel, under the draw.io add-on heading, select Configuration. Then select the Configuration tab.
  5. In the Server Configuration field, add the key/value pair: viewerurl=https://jgraph.github.io/drawio//src/main/webapp/js/viewer.min.js then click Save changes.
    Add the URL to your self-hosted JavaScript viewer script to the draw.io Server Configuration field