draw.io (formerly also known as diagrams.net) is an editor for all kinds of diagrams: flowcharts, network diagrams, organizational charts, UML, ER diagrams, wireframes, and whiteboard sketches. You drag shapes from large libraries onto the canvas, connect them with arrows, and export the result as an image or PDF. The editor is open source (Apache-2.0 license) and runs entirely in your browser.
In this guide, we’ll show you two ways to set it up: the easy way, as a One-Click App, which makes draw.io available at your own address over HTTPS in just a few clicks, and the manual installation with Docker Compose, following the official guide. After that, you’ll learn where your diagrams are stored, how to back them up, and what the self-hosted version can and can’t do.
draw.io is available for free at app.diagrams.net and as a desktop app. Running your own instance on a VPS is worthwhile if:
- Your team should be able to use the editor at your own address, such as
diagramme.example.com, without installing anything on each computer. - The interface should be served from your own server instead of a third-party website. The diagrams themselves remain on users’ devices.
- You work on computers where you’re not allowed to install programs, but you do have a browser.
- You want to configure the editor centrally, for example with custom fonts or a default language for everyone (with the manual installation).
The self-hosted version is less suitable if you want to store diagrams centrally on the server, organize them in folders, or protect them with user accounts. draw.io can’t do that on its own. See “What the Self-Hosted Version Can’t Do” for more information. If you work alone on one computer, the draw.io desktop app is often enough.
The One-Click Apps catalog also includes Excalidraw for quick, hand-drawn-style sketches and drawDB for database schemas. draw.io is the right choice when you need clean, precisely scaled diagrams with lots of ready-made shapes.
The quickest way to get draw.io is through your VPS’s One-Click Apps. The app is available directly over HTTPS with a domain. You don’t need a reverse proxy, certificate, or firewall rules.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
- About 512 MB of free RAM; 1 GB is recommended. draw.io runs on a Java web server (Tomcat), which needs a little more memory than a basic website.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search the App catalog for draw.io and click Install app.
- Use a custom subdomain or zap.cloud is already selected. Leave it enabled and enter a name, for example
team-diagramme. You’ll be able to access draw.io over HTTPS at this domain. - There are no other required fields. draw.io doesn’t need login credentials or a database.
- Click Queue installation. After a few minutes, draw.io will show as online on the app card. For zap.cloud, ZapX adds your server number to the name. You can see the complete address in the form.
Open the app’s Access link. draw.io starts without a login and opens a blank canvas (“Untitled Diagram”). On the left, you’ll find the shape libraries, which you can add with a click or by dragging. On the right are the properties of the selected element. You can enable more libraries, such as Cisco, AWS, Azure, Kubernetes, BPMN, or racks, using More Shapes in the bottom-left corner.
The interface is in English by default. Go to Extras > Language and choose your language, such as German. After reloading the page, the menus will be in German, and draw.io will remember your choice in your browser. This guide uses the English menu names.
draw.io doesn’t automatically save a new diagram. If you reload the page or close the tab before saving, it will be lost. You’ll see the message “Unsaved changes. Click here to save.” at the top. Save your diagram right away with Strg+S, as described in “Where Your Diagrams Are Stored.”
Anyone who knows the access link can open the editor and use it through your server. They can’t see your diagrams, though, because the diagrams are stored on your device or in your browser, not on the server. The One-Click App doesn’t provide its own password protection. Only share the link with people who should use it. If you want to require a login, use the manual installation with Basic Auth, as described below in “Protect Your Instance with a Password.”
To check for a new version, open the app settings (gear icon) and select Check for updates under App update. Install a new version by clicking Apply update. If the page says the app is up to date, there isn’t a newer version in the App Catalog.
There’s nothing to back up on the server: the app doesn’t store diagrams there. Back up your work as a file, as described below in “Back Up and Share Diagrams.”
The rest of this guide describes how to manually install draw.io with Docker Compose on your VPS. You might choose this option if you don’t use One-Click Apps on your server, want to password-protect draw.io, or want to configure the editor centrally. The instructions are based on the official draw.io Docker guide.
- A Linux VPS running Debian or Ubuntu, with SSH access. See First SSH Access.
- Docker and Docker Compose. See Install Docker. Verify the installation with
docker --versionanddocker compose version. - For HTTPS: a domain or subdomain whose A record points to your VPS’s IP address (e.g.,
diagramme.example.com).
The official image includes a Tomcat web server with the draw.io files ready to use. These resources are sufficient:
| Minimum | Recommended | |
|---|---|---|
| CPU | 1 vCore | 2 vCores |
| RAM | 512 MB | 1 GB |
| Storage | 2 GB | 3 GB |
draw.io listens on port 8080 inside the container. You don’t need to open this port if you use a reverse proxy as described below. With ufw, allow only SSH and the ports used by the reverse proxy:
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Ports published by Docker using ports: are accessible from outside even if ufw blocks them. Docker adds its own rules ahead of ufw’s rules. So, as in the Compose file below, bind draw.io only to 127.0.0.1. See Managing the Firewall on Linux for more information.
Create a directory for draw.io and navigate to it:
mkdir -p /opt/drawio
cd /opt/drawio
Create the Compose file with nano docker-compose.yml. It uses the official jgraph/drawio image, at the same version as the One-Click App, and a port that’s only accessible locally:
services:
drawio:
image: jgraph/drawio:32.7.4
container_name: drawio
restart: unless-stopped
ports:
- 127.0.0.1:8080:8080
environment:
DRAWIO_SERVER_URL: https://diagramme.example.com/
DRAWIO_LANG: de
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
Here’s what the entries mean:
image: The official image with a fixed version number. You can see the available versions on Docker Hub.127.0.0.1:8080:8080: draw.io is accessible only from the server itself. External access goes through the reverse proxy. You don’t need the image’s second port,8443(HTTPS with a self-signed certificate), behind a reverse proxy.DRAWIO_SERVER_URL: The public address of your instance, with a slash at the end. Replacediagramme.example.comwith your domain.DRAWIO_LANG: The default interface language, set to German here. Without this entry, draw.io starts in English. Users can still change the language themselves.healthcheck: Checks whether the web server is responding, just as it does in the One-Click App.
You don’t need a volume because draw.io doesn’t store data on the server. Start the container:
docker compose up -d
Check that everything is running with docker compose ps. After about half a minute, the status should show healthy.
Because draw.io listens only on 127.0.0.1, you’ll access the editor through an SSH tunnel the first time. Run this on your own computer:
ssh -L 8080:localhost:8080 root@SERVER_IP
Replace SERVER_IP with your VPS’s IP address and open http://localhost:8080 in your browser. If you see the blank canvas with German menus, the installation is working and DRAWIO_LANG has taken effect.
To access draw.io without a tunnel, place a reverse proxy with a valid certificate in front of it. For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). Here’s a server block for nginx:
server {
listen 80;
server_name diagramme.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Then obtain the certificate with certbot --nginx -d diagramme.example.com. Certbot adds HTTPS and the HTTP redirect to the block. HTTPS is important for draw.io: browsers allow direct saving to a file on your computer and clipboard access only over a secure connection.
draw.io doesn’t have its own login. If you want only your team to be able to open the editor, add a username and password prompt (Basic Auth) in front of it in the reverse proxy. Install the tool for creating the password file and add a user:
apt install apache2-utils
htpasswd -c /etc/nginx/drawio.htpasswd DEIN_NAME
Add more users with htpasswd /etc/nginx/drawio.htpasswd NAME, without -c. Add these two lines to the location block in your server block, then reload nginx with systemctl reload nginx:
auth_basic "draw.io";
auth_basic_user_file /etc/nginx/drawio.htpasswd;
The first time you visit, your browser will ask for a username and password. See Linux Security Tips for more ways to secure your server.
The server only stores the Compose file and, if created, the password file. Back up both:
tar -czf drawio-backup-$(date +%F).tar.gz /opt/drawio/docker-compose.yml /etc/nginx/drawio.htpasswd
Back up your diagrams on your own device. See “Back Up and Share Diagrams” in the next section.
Change the image version number in docker-compose.yml, for example, to jgraph/drawio:32.7.7. Then pull the image and restart the container:
cd /opt/drawio
docker compose pull
docker compose up -d
Since draw.io doesn’t store data on the server, nothing will be lost. Remove old images with docker image prune.
Once setup is complete, you can get started right away. The most important thing to know is where your diagrams are stored, since this differs from cloud services such as Google Drive.
The server only serves the editor. You create diagrams in your browser and save them on your device. When saving a diagram (Strg+S), choose a storage location under Where:
- Device: Saves the file directly to your computer. This option is available only in Chrome and Edge. Your browser will ask you to choose a folder and file name.
- Browser: Saves the diagram in your browser’s storage. Later, open it by going to File > Open from > Browser, where all diagrams saved this way are listed with their date and size. draw.io automatically saves changes here (Autosave). This applies only to this browser, on this device, at this exact address. If you delete your browser data or use a private window, the diagrams will be lost.
- Download: Downloads the diagram as a file. In Firefox and Safari, this is the way to save a file, alongside Browser. After making changes, download a new version.
.draw.io suggests .drawio as the file type. You can also save an editable PNG or SVG image that includes the diagram.
When you save or open a diagram, draw.io doesn’t send it to your VPS. Exporting as PNG, SVG, or PDF also happens in your browser. An external export service is disabled in the official image. In our test, the editor loaded only files from its own instance when opening, saving, and exporting, and didn’t connect to any third-party servers.
draw.io saves diagrams as .drawio files. This is an open XML format that you can open again in draw.io at any time, including in the desktop app or at app.diagrams.net. Here’s how to back up and share your work:
- Save As: Go to File > Save as to save a copy as a file on your computer. For example, you can store it in your cloud or in your project’s Git repository.
- As an image: Go to File > Export as to export as PNG, JPEG, or SVG. For PNG and SVG, you can embed a copy of the diagram in the image file so it can be edited in draw.io later.
- As a PDF: Export as > PDF opens your browser’s print dialog. Choose “Save as PDF” as the destination.
- Open: Go to File > Open from > Device to open a
.drawiofile or an image with an embedded diagram.
- No accounts or server storage: There are no users or shared file lists. Anyone who needs to edit a diagram must be given the file.
- No Google Drive, OneDrive, or GitLab out of the box: These storage options appear only if you create your own credentials (OAuth) with the relevant provider and add them as variables during the manual installation. The One-Click App doesn’t provide fields for this.
- No sharing or live collaboration: The Share button in the top-right only indicates that sharing works with Google Drive and OneDrive files. Without those storage options, you share diagrams as files; real-time collaborative editing isn’t available.
- PDF export only through the print dialog: The option to embed a copy of the diagram in a PDF isn’t available because there’s no export server running.
- AI features require your own key: AI-powered diagram creation is disabled. With the manual installation, you can enable it using
DRAWIO_CONFIGand your own API key. See the official guide. - Note from the developer: According to the official Docker guide, the free image is intended for testing and evaluation. The developer offers a paid version for production use.
You now have draw.io at your own address, where your team draws diagrams without an account or installation, keeps them on their own devices, and saves and shares them as .drawio files. Next, Set Up BookStack on a Linux Server shows you how to build your own wiki where your diagrams sit right next to your documentation.
If you have any other questions or need help, our support team is available every day! 🙂
