$100 Website Offer

Get your personal website + domain for just $100.

Limited Time Offer!

Claim Your Website Now

How to install Excalidraw in Linux?

let’s deploy a static Excalidraw embed under your cPanel hosting at:

Filesystem: /home/toolsdevopsschoo/public_html/excalidraw
URL:       https://tools.devopsschool.com/excalidraw/

This method needs no Node.js server running on cPanel (just static files). You’ll build locally on the server via SSH and copy the build output into public_html/excalidraw.


Step-by-Step (SSH)

0) Prereqs (one time)

# Log in over SSH, then check Node & npm
node -v
npm -v

If Node is missing or < 18, install with nvm:

# Install nvm (if not present)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc  # or: source ~/.zshrc

# Install and use an LTS Node
nvm install --lts
nvm use --lts

1) Create a fresh React app (outside public_html)

cd ~
npm create vite@latest excali-static -- --template react
cd excali-static
npm install
npm install @excalidraw/excalidraw

2) Wire Excalidraw into the app

2.1 Replace src/App.jsx

// /home/toolsdevopsschoo/excali-static/src/App.jsx
import { useEffect, useRef } from "react";
import { Excalidraw } from "@excalidraw/excalidraw";

export default function App() {
  const wrap = useRef(null);

  useEffect(() => {
    document.body.style.margin = "0";
    if (wrap.current) wrap.current.style.height = "100vh";
  }, []);

  return (
    <div ref={wrap}>
      <Excalidraw />
    </div>
  );
}

(Keep the default src/main.jsx from Vite; no change needed.)

2.2 Set Vite base path so assets load from /excalidraw/

// /home/toolsdevopsschoo/excali-static/vite.config.js
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
  base: "/excalidraw/",   // IMPORTANT: site is served from /excalidraw/
});

3) Build for production

cd ~/excali-static
npm run build
# Output appears in: ~/excali-static/dist

4) Deploy to your web root

# Make/clean the target folder under public_html
mkdir -p /home/toolsdevopsschoo/public_html/excalidraw
rm -rf /home/toolsdevopsschoo/public_html/excalidraw/*

# Copy the built files
cp -r ~/excali-static/dist/* /home/toolsdevopsschoo/public_html/excalidraw/

Open: https://tools.devopsschool.com/excalidraw/ 🎉


5) (If you see missing icons/images) add excalidraw-assets

Newer versions usually handle assets automatically. If your browser console shows 404s for excalidraw-assets, do this:

mkdir -p /home/toolsdevopsschoo/public_html/excalidraw/excalidraw-assets
cp -r ~/excali-static/node_modules/@excalidraw/excalidraw/dist/excalidraw-assets/* \
      /home/toolsdevopsschoo/public_html/excalidraw/excalidraw-assets/

Reload the page.


6) Optional: add caching + security headers

Create /home/toolsdevopsschoo/public_html/excalidraw/.htaccess:

# Caching (safe defaults)
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/javascript "access plus 7 days"
  ExpiresByType text/css "access plus 7 days"
  ExpiresByType image/png "access plus 30 days"
  ExpiresByType image/svg+xml "access plus 30 days"
</IfModule>

# Security headers
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "no-referrer-when-downgrade"
  Header set X-Frame-Options "SAMEORIGIN"
</IfModule>

If your host uses aggressive caching, remember to re-upload after each new build.


7) Update flow (next time you change something)

cd ~/excali-static
npm run build
rm -rf /home/toolsdevopsschoo/public_html/excalidraw/*
cp -r dist/* /home/toolsdevopsschoo/public_html/excalidraw/

Notes & Tips

  • This approach is static (no collaboration server). It’s perfect for shared cPanel hosting.
  • If you must run the full Excalidraw app from the official repo (Next.js), your cPanel plan must support Node.js/Passenger apps. If you have that, say the word and I’ll give you those steps too.
  • Always set base: "/excalidraw/" in vite.config.js since the site is served from a subpath.

If you want, I can also add toolbar theming (light/dark), export buttons, or a save-to-JSON flow in this static build—just say the word and I’ll extend App.jsx.

Related Posts

Navigating Legal Care in India: How to Evaluate Advocates, Practice Areas, and Consultations

Introduction Facing a legal question, business compliance issue, or court dispute can feel overwhelming. Whether you are dealing with a property transaction, a family dispute, an employment…

Read More

Navigating International Dental Care: How to Evaluate Hospitals, Dentists, and Treatment Abroad

Introduction Choosing a dental provider is one of the most critical health decisions a person can make, especially when considering travel outside one’s home country. Today, millions…

Read More

Navigating Modern Indian Taxation, Business Compliance, and Strategic Financial Advisory

Introduction Managing personal finances, scaling a startup, or running an established corporate enterprise in India requires strict adherence to an evolving regulatory landscape. From seasonal tax updates…

Read More

Navigating the Modern Event Ecosystem: Event Discovery, Digital Ticketing, and Management in Bangalore

Introduction Bangalore—often celebrated as India’s Silicon Valley and cultural melting pot—pulses with non-stop energy. On any given day, thousands of working professionals, students, creators, startup founders, and…

Read More

Evaluating Business Software, AI Platforms, and Enterprise Technology Solutions

Introduction The modern enterprise software ecosystem is expanding at an unprecedented rate. From cloud-native SaaS applications and AI-driven workflow engines to complex infrastructure management frameworks, technology leaders…

Read More

Enterprise AI Training and Certification Guide for Modern Professionals

Introduction Artificial intelligence has rapidly evolved from an experimental sandbox project into a fundamental core infrastructure requirement for global enterprises. Organizations across every sector are no longer…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x