Run your own draw.io server with Docker
Run your own diagramming server using our Docker image of draw.io. The editor renders and exports diagrams in the browser, creates PDF files through your browser's print dialog, and can be configured for diagram storage with Google Drive and OneDrive, without any dependency on the draw.io export servers.

There are many reasons that a SaaS application is not the right choice and companies prefer to run their own environment, where all of their data and applications are kept behind a firewall for maximum security. Containerised software applications are isolated from their environment, inherently providing better security.
Docker containers also avoid problems created by missing or outdated dependencies on other software components because everything needed to run the application is packed with it in that container.
Run the draw.io Docker image
The draw.io Docker image is based on Tomcat to support reverse proxies, and is kept up to date with the production draw.io running on app.diagrams.net.
- Install and run the Docker platform on your server or desktop machine.
- Run the draw.io Docker container:
docker run -it --rm --name="draw" -p 8080:8080 -p 8443:8443 jgraph/drawio
Note: Use the DRAWIO_* environment variables listed in docker-entrypoint.sh in the main directory to set up certificates and access to an SSL keystore mount. For example, a configured command will look similar to:
docker run -it -m1g -e LETS_ENCRYPT_ENABLED=true -e PUBLIC_DNS=drawio.example.com --rm --name="draw" -p 80:80 -p 443:8443 jgraph/drawio
For more information on setup and configuration options, refer to the draw.io Docker image page on DockerHub.
PDF and image export
The image does not include an export server. Its entrypoint writes window.EXPORT_URL = null; into PreConfig.js, which tells the editor that no export service is available. In draw.io versions newer than 31.4.2 this means:
- File > Export as > PDF opens the print dialog, and your browser saves the PDF file. The Include a copy of my diagram option is not offered for PDF, as embedding the diagram data in a PDF file requires the export service.
- PNG, JPEG, WebP, SVG, HTML and XML exports are rendered in the browser as usual. The server-rendered PNG and JPEG export used by browsers without canvas support is hidden.
- No diagram data leaves your server for an export.
If you run your own export server, set window.EXPORT_URL to its URL in PreConfig.js instead of null. The public draw.io source code ships src/main/webapp/js/PreConfig.js with the same null default for builds from source.
Note: Older versions replace null with the default export URL on the draw.io servers, which only accept requests from the draw.io domains. In those versions, Export as > PDF opens a new tab with an error instead of the print dialog - print to PDF via File > Print instead.