How to Install Draw.io Desktop on Ubuntu 26.04, 24.04 and 22.04

Last updated Wednesday, April 29, 2026 11:38 am Joshua James 7 min read 6 comments

Complex diagrams are easier to build when your flowcharts, network maps, UML layouts, and database schemas are available offline instead of tied to a browser session. You can install Draw.io on Ubuntu 26.04 LTS (resolute), 24.04 LTS (noble), and 22.04 LTS (jammy) as the diagrams.net desktop app through the official .deb release, Snapcraft, or Flathub.

Draw.io and diagrams.net refer to the same JGraph project. Ubuntu does not provide a default repository package named drawio, so sudo apt install drawio will not fetch the desktop app by itself. Use the GitHub .deb package for direct local installation and the most predictable command-line export path, Snap for automatic store updates on standard Ubuntu desktops, or Flatpak if you already use Flathub for sandboxed desktop apps.

Install Draw.io on Ubuntu

Choose one method from the table before running commands. All three install the same desktop application family, but they differ in update behavior, sandboxing, and command-line convenience.

MethodSourceChannelUpdatesBest Fit
.deb packageGitHub ReleasesLatest GitHub stable releaseManual download or helper scriptDirect Ubuntu package install, local file handling, and CLI export
Snap stableSnapcraft, publisher jgraph**Stable Snap channelAutomatic Snap refreshesMost Ubuntu desktop users who prefer a conservative store channel
Snap edgeSnapcraft edge channelEdge Snap channelAutomatic Snap refreshesUsers who want the newest Snap build and accept edge-channel risk
FlatpakFlathubLatest Flathub stable releaseflatpak updateSandboxed desktop installs through an existing Flathub workflow

Use one install method unless you intentionally want multiple isolated copies. The .deb, Snap, and Flatpak builds use different package managers and different data paths, so mixing them can make launch commands, updates, and cleanup harder to reason about.

Install Draw.io with the .deb Package

The .deb package is the best Ubuntu choice when you want a normal system package, the /usr/bin/drawio launcher, and repeatable command-line export. GitHub releases also publish an AppImage and RPM, but the .deb package fits Ubuntu better because apt can register the package and resolve dependencies.

Update Ubuntu Before Installing Draw.io

Refresh APT metadata and apply pending package updates before installing the downloaded package:

sudo apt update && sudo apt upgrade -y

These commands use sudo for root-level package changes. If your account cannot run sudo yet, follow the guide on how to add a new user to sudoers on Ubuntu before continuing.

Install Download Tools for Draw.io

Install curl and jq. The download workflow uses curl to fetch GitHub release metadata and jq to parse the JSON response safely instead of relying on a fragile text match:

sudo apt install curl jq -y

If you want more background on the download command itself, see the curl command guide.

Resolve the Latest Draw.io .deb URL

Fetch the latest GitHub release metadata, extract the current amd64 .deb asset, and print the URL so you can confirm the package format before downloading it:

curl -fsSL https://api.github.com/repos/jgraph/drawio-desktop/releases/latest -o /tmp/drawio-release.json
DEB_URL=$(jq -r '.assets[] | select(.name | test("^drawio-amd64-.*\\.deb$")) | .browser_download_url' /tmp/drawio-release.json | head -n 1)

if [ -z "$DEB_URL" ] || [ "$DEB_URL" = "null" ]; then
  echo "No amd64 .deb asset found in the latest draw.io release."
  exit 1
fi

printf '%s\n' "$DEB_URL"

The output should be a GitHub release URL ending in an amd64 .deb file:

https://github.com/jgraph/drawio-desktop/releases/download/v29.x.x/drawio-amd64-29.x.x.deb

Download and Install the Draw.io .deb Package

Run the next command in the same terminal session so the DEB_URL variable remains available. The first line saves the package locally, and the second line installs it with APT:

curl -fL -o drawio-amd64.deb "$DEB_URL"
sudo apt install ./drawio-amd64.deb -y

Relevant output includes the package setup line and the launcher registration:

Setting up draw.io (29.x.x) ...
update-alternatives: using /opt/drawio/drawio to provide /usr/bin/drawio (drawio) in auto mode

Verify the Draw.io .deb Installation

Confirm that the package is installed and that Ubuntu can find the terminal launcher:

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package} ${Version}\n' draw.io
command -v drawio
ii  draw.io 29.x.x
/usr/bin/drawio

Remove the downloaded package file and temporary release metadata after the install succeeds:

rm -f drawio-amd64.deb /tmp/drawio-release.json

Install Draw.io with Snap

Snap is available on standard Ubuntu desktop installations and updates applications automatically. The Draw.io Snap is published by the verified Snapcraft publisher jgraph**. Use the stable channel unless you specifically need the newest release from the edge channel.

Install Draw.io from the Stable Snap Channel

Install the stable Snap channel with the following command:

sudo snap install drawio
drawio 28.2.x from draw.io (jgraph**) installed

Use the Draw.io Edge Snap Channel

The edge channel currently tracks the newest Draw.io release more closely than stable. Use it only if you accept the extra risk that comes with pre-stable Snap publishing.

If Draw.io is not installed yet, install the edge channel directly:

sudo snap install drawio --edge

If you already installed the stable channel, switch the existing Snap to edge instead:

sudo snap refresh drawio --edge

Verify the Draw.io Snap Installation

Check the installed version, channel, publisher, and revision:

snap list drawio
Name    Version  Rev  Tracking       Publisher  Notes
drawio  28.2.x   255  latest/stable  jgraph**   -

To compare stable and edge before switching channels, inspect the live Snap metadata:

snap info drawio | grep -E 'latest/(stable|edge)'

This command uses grep to show only the channel lines; the grep command guide covers the same filtering pattern in more detail.

  latest/stable:    28.2.x 2026-02-23 (255) 134MB -
  latest/edge:      29.7.x 2026-04-24 (272) 136MB -

Install Draw.io with Flatpak

Flatpak is useful when you already prefer sandboxed desktop apps and Flathub updates. The Draw.io Flathub listing currently reports version 29.7.x, but Flathub marks the listing as unverified, so choose this method for its sandbox and update workflow rather than as an upstream-verified package.

Ubuntu does not include Flatpak by default. The commands below install the Flatpak package and add Flathub at system scope. For a deeper setup walkthrough, see the guide on how to install Flatpak on Ubuntu.

Install Flatpak and Add Flathub

Install Flatpak first, then add the current Flathub repository descriptor:

sudo apt install flatpak -y
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Confirm that Flathub exists at the intended system scope:

flatpak remotes --columns=name,url
flathub  https://dl.flathub.org/repo/

Install Draw.io from Flathub

Install the Draw.io Flatpak app ID from Flathub. The -y flag accepts Flatpak’s install prompt, including required runtime downloads:

sudo flatpak install flathub com.jgraph.drawio.desktop -y
Installation complete.

Verify the Draw.io Flatpak Installation

List the installed app, version, branch, and installation scope:

flatpak list --app --columns=application,version,branch,installation | grep -F com.jgraph.drawio.desktop
com.jgraph.drawio.desktop  29.7.x  stable  system

Launch Draw.io on Ubuntu

Launch Draw.io from the Terminal

The terminal launch command depends on the install method. For the .deb package, run:

drawio

For the Snap package, use snap run. The drawio shortcut may also work when /snap/bin is already in your session path, but snap run drawio is the reliable form:

snap run drawio

For the Flatpak package, launch the app by ID:

flatpak run com.jgraph.drawio.desktop

Export Draw.io Files from the Terminal

The .deb package is the cleanest choice if you need command-line export for local files. From a normal desktop terminal, export a diagram with the drawio launcher:

drawio --export --format svg --output diagram.svg diagram.drawio
diagram.drawio -> diagram.svg

Draw.io export still starts the Electron runtime. On SSH or CI systems without a graphical display, install xvfb and wrap the same export command in a virtual display:

sudo apt install xvfb -y
xvfb-run -a drawio --export --format svg --output diagram.svg diagram.drawio

Sandboxed Snap and Flatpak builds are better treated as desktop launch methods unless you have tested their file access and graphics behavior for your export workflow.

Launch Draw.io from the Applications Menu

Open the Activities overview or application menu, search for draw.io, and launch the desktop entry. The first screen lets you choose a template, start a blank diagram, or open an existing .drawio file.

Manage Draw.io on Ubuntu

Update Draw.io

Update commands are method-specific. Snap and Flatpak update through their package managers, while the .deb package needs a fresh GitHub release download or the helper script below.

Update the Snap package with:

sudo snap refresh drawio

Update the Flatpak package with:

sudo flatpak update com.jgraph.drawio.desktop -y

Create a Draw.io .deb Update Helper

If you installed the GitHub .deb package, create a small helper in /usr/local/bin. The script checks the latest release, verifies that an amd64 .deb asset exists, stores the download under your cache directory, and installs only when the version changed.

sudo tee /usr/local/bin/update-drawio > /dev/null <<'SCRIPT'
#!/usr/bin/env bash
set -euo pipefail

api_url="https://api.github.com/repos/jgraph/drawio-desktop/releases/latest"
cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/drawio-updater"
release_json="$cache_dir/release.json"

for tool in curl jq; do
  if ! command -v "$tool" >/dev/null 2>&1; then
    echo "Error: $tool is required. Install it with: sudo apt install curl jq -y" >&2
    exit 1
  fi
done

if ! dpkg-query -W -f='${db:Status-Abbrev}' draw.io 2>/dev/null | grep -q '^ii'; then
  echo "Draw.io is not installed from the .deb package." >&2
  exit 1
fi

mkdir -p "$cache_dir"
curl -fsSL "$api_url" -o "$release_json"

current_version=$(dpkg-query -W -f='${Version}' draw.io)
latest_version=$(jq -r '.tag_name | sub("^v"; "")' "$release_json")
deb_url=$(jq -r '.assets[] | select(.name | test("^drawio-amd64-.*\\.deb$")) | .browser_download_url' "$release_json" | head -n 1)

if [ -z "$latest_version" ] || [ "$latest_version" = "null" ] || [ -z "$deb_url" ] || [ "$deb_url" = "null" ]; then
  echo "Error: Could not resolve the latest draw.io .deb release." >&2
  exit 1
fi

if [ "$current_version" = "$latest_version" ]; then
  echo "Draw.io is already current ($current_version)."
  exit 0
fi

deb_file="$cache_dir/drawio-amd64-$latest_version.deb"
curl -fL -o "$deb_file" "$deb_url"
sudo apt install "$deb_file" -y

new_version=$(dpkg-query -W -f='${Version}' draw.io)
echo "Draw.io updated from $current_version to $new_version."
SCRIPT

Make the helper executable:

sudo chmod +x /usr/local/bin/update-drawio

The chmod +x command adds execute permission to the helper; see the chmod command guide if you want a deeper permission reference.

Run the updater whenever you want to check GitHub for a newer .deb release:

update-drawio
Draw.io is already current (29.x.x).

Remove Draw.io

Use the removal command that matches your install method. Export any important diagrams and close the application before removing packages or user data.

For the .deb package, purge the package, remove the optional update helper and cache if you created them, then clear the shell command cache before checking the installed state:

sudo apt purge draw.io -y
sudo rm -f /usr/local/bin/update-drawio
rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/drawio-updater"
hash -r
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' draw.io 2>/dev/null | grep '^ii' || echo "draw.io not installed"
command -v update-drawio >/dev/null 2>&1 || echo "update-drawio helper removed"
draw.io not installed
update-drawio helper removed

For the Snap package, remove the app without saving a Snap recovery snapshot:

sudo snap remove --purge drawio
snap list drawio 2>/dev/null || echo "drawio not installed"
drawio not installed

For the Flatpak package, remove the app and its sandbox data, then remove unused runtimes if Flatpak reports any:

sudo flatpak remove --delete-data com.jgraph.drawio.desktop -y
flatpak list --app --columns=application | grep -Fx com.jgraph.drawio.desktop || echo "com.jgraph.drawio.desktop not installed"
sudo flatpak uninstall --unused -y
com.jgraph.drawio.desktop not installed

For a full reset after a .deb install, remove Draw.io’s user configuration and cache directories. This deletes settings, recent-file history, and cached application data, so run it only when you do not need that local state anymore:

rm -rf ~/.config/draw.io ~/.cache/draw.io

Troubleshoot Draw.io on Ubuntu

Check Draw.io Launch Errors

If Draw.io does not open from the application menu, start it from a terminal with the command for your install method. Terminal output is usually enough to show whether the issue is a missing display session, GPU rendering problem, sandbox permission, or package launch failure.

drawio
snap run drawio
flatpak run com.jgraph.drawio.desktop

If the .deb or Snap build opens to a blank window or exits with GPU-related messages, retry with Electron’s GPU-disabled launch flag:

drawio --disable-gpu
snap run drawio --disable-gpu

Fix Flatpak File Dialog Issues

Flatpak file dialogs depend on desktop portals. If the Draw.io Flatpak opens but cannot show the file picker correctly, install the GTK portal packages and restart your desktop session:

sudo apt install xdg-desktop-portal xdg-desktop-portal-gtk -y

Allow Snap Access to Removable Drives

The Draw.io Snap has normal home-directory access, but removable drive access is a separate Snap interface. Check the current connections first:

snap connections drawio | grep -E 'home|removable-media'
home              drawio:home             :home  -
removable-media   drawio:removable-media  -      -

If removable-media is disconnected and you need diagrams on mounted USB or external drives, connect it manually:

sudo snap connect drawio:removable-media

Adjust Draw.io HiDPI Scaling

On high-resolution displays, the .deb build can be launched with a GTK scale factor or an Electron device-scale factor. Use only one of these examples at a time:

GDK_SCALE=2 drawio
drawio --force-device-scale-factor=1.5

Conclusion

Draw.io is ready on Ubuntu for offline diagrams, template-based workflows, and local exports. The .deb package is the better fit for direct system integration and CLI export, while Snap and Flatpak keep updates inside their own package managers. For adjacent creative tools, install Inkscape on Ubuntu for SVG editing or install GIMP on Ubuntu for image work.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee

6 thoughts on “How to Install Draw.io Desktop on Ubuntu 26.04, 24.04 and 22.04”

    • Thanks for catching that, Sven. You were right. The filename format changed from drawio-amd64.deb to drawio-amd64-29.0.3.deb, which broke the original grep pattern.

      The command has been updated to use a more robust regex that handles version numbers:

      curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep -oP '"browser_download_url": "\K[^"]*amd64[^"]*\.deb' | wget -i -

      This should handle future filename format changes as well. Appreciate the heads up.

      Reply
  1. Yes the “Download Draw.io Latest .deb package” fails for me with: “No URLs found in -.”

    This seems to work:

    curl -LO $(curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | awk ‘/browser_download_url/ && /amd/ && /deb/’ | cut -d ‘”‘ -f 4)

    It eliminates wget but requires awk. I’m using Ubuntu 25.04.

    -tom

    Reply
    • Thanks for the alternative approach, Tom. You and Sven hit the same issue. The filename format changed from drawio-amd64.deb to drawio-amd64-29.0.3.deb, which broke the original grep pattern expecting them adjacent.

      The article now uses a Perl-compatible regex that handles version numbers in the filename:

      curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep -oP '"browser_download_url": "\K[^"]*amd64[^"]*\.deb' | wget -i -

      Your curl -LO with awk works too. Both approaches should handle future filename changes. Appreciate you sharing the workaround.

      Reply
  2. The download step for the deb file no longer works, since grep ‘amd64\.deb’ doesn’t match any drawio-amd64-$version.deb
    Changing it to grep — ‘-amd64-.*deb’ would be a possible fix.

    Reply
    • Thanks for flagging this, Arthur. You were the first to catch it. The filename format changed from drawio-amd64.deb to drawio-amd64-29.0.3.deb, breaking the original pattern.

      The article now uses a Perl-compatible regex that handles version numbers:

      curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep -oP '"browser_download_url": "\K[^"]*amd64[^"]*\.deb' | wget -i -

      Your suggested fix would have worked too. Appreciate you taking the time to report this and propose a solution.

      Reply
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: