Back to articles
DevOps & Systems

How to Self-Host Excalidraw on Docker VPS for Internal Diagrams and Internal Collaboration in Enterprises

A detailed guide on self-hosting Excalidraw on a Docker VPS to build an internal diagramming platform, supporting effective collaboration and internal management for businesses.

DPTCloud Engineering4 min read
How to Self-Host Excalidraw on Docker VPS for Internal Diagrams and Internal Collaboration in Enterprises

Image credit: wikimedia

Excalidraw is a visual, open-source, and free diagramming tool widely used by businesses to illustrate ideas, design workflows, and support internal collaboration. While the free version on Excalidraw.com stores diagrams on their servers, self-hosting allows enterprises to maintain full control over internal data, enhance security, and customize the platform to fit their needs. This guide walks you through deploying Excalidraw on an NVMe Cloud VPS using Docker, Nginx, and a database, creating a secure, efficient, and internal diagramming platform.

Overview of Excalidraw and Benefits of Self-Hosting

Excalidraw is a web-based application that enables users to create diagrams, flowcharts, and illustrations without requiring an account. The hosted version, while convenient, stores data externally. By self-hosting, businesses gain:

  • Full control over internal data and privacy.
  • Customizable interface and features to match internal workflows.
  • Operation on private infrastructure, increasing security and control.
  • Integration with internal systems such as Nextcloud, Git, or collaboration tools.

Prerequisites and Environment Setup

To deploy Excalidraw on a VPS, you will need:

  • A NVMe Cloud VPS (see more: NVMe Cloud VPS for Docker, Nginx & Databases).
  • Ubuntu 20.04/22.04 or a compatible Linux distribution.
  • Docker and Docker Compose installed.
  • SSL support via Let's Encrypt for secure access.
  • A public domain name or IP address.

Deploying Excalidraw on Docker VPS

Follow these steps to self-host Excalidraw:

1. Install Docker and Docker Compose

Run the following commands on your VPS:

sudo apt update
sudo apt install -y docker.io docker-compose
sudo usermod -aG docker $USER
newgrp docker

2. Create Directory and Configuration File

Set up a directory and create the `docker-compose.yml` file:

mkdir -p ~/excalidraw && cd ~/excalidraw
nano docker-compose.yml

Enter the following content into the file:

version: '3.8'

services:
  excalidraw:
    image: excalidraw/excalidraw:latest
    container_name: excalidraw
    ports:
      - "8080:80"
    volumes:
      - ./data:/data
    restart: unless-stopped
    environment:
      - NODE_ENV=production
      - EXCALIDRAW_DATA_DIR=/data

3. Start the Service

Run the following command to start the service:

docker-compose up -d

4. Configure Nginx and SSL

Create an Nginx configuration file (e.g., `/etc/nginx/sites-available/excalidraw`):

server {
    listen 80;
    server_name your-domain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Configure Let's Encrypt (if not already set up):

sudo apt install -y certbot
sudo certbot certonly --nginx -d your-domain.com

Testing and Verification

After completion, access https://your-domain.com to use Excalidraw. You can create, save, and share internal diagrams.

Troubleshooting

  • Cannot access service: Verify Docker is running and port 8080 is open.
  • Diagrams not saving: Check that the /data directory has write permissions.
  • SSL errors: Confirm the domain and Let's Encrypt certificate are correctly configured.

References

Self-hosting Excalidraw on a Docker VPS enables businesses to build a secure, customizable, and efficient internal diagramming platform, enhancing collaboration and internal management.

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478