Install Excalidraw on Debian 12 with Docker + Nginx

Estimated reading: 3 minutes 725 views

Introduction

In this tutorial, we’re going to install and run Excalidraw on a Debian 12 server using Docker, then expose it publicly using Nginx as a reverse proxy.

Excalidraw will run inside a Docker container and will only be accessible locally on 127.0.0.1.
Nginx will handle all incoming traffic on port 80 and forward it to Excalidraw.
This setup is clean, lightweight, and secure—perfect for personal use or small teams.

Step 1: Connect to the Debian 12 Server

First, let’s connect to the server via SSH:

ssh root@YOUR_SERVER_IP

This opens a secure shell session with full root access.


Step 2: Update the Operating System

Next, let’s update the package index and install the latest upgrades:

apt update
apt upgrade -y

This reduces security risks and helps avoid dependency issues later.


Step 3: Install Docker Engine

Now we’ll install Docker using the official installation script:

curl -fsSL https://get.docker.com | sh

Enable Docker to start automatically on boot and start it immediately:

systemctl enable docker
systemctl start docker

Verify Docker is installed correctly:

docker --version

Step 4: Install Docker Compose Plugin

We’ll install Docker Compose v2 as a plugin:

apt install docker-compose-plugin

Then verify it’s working:

docker compose version

Step 5: Create the Excalidraw Project Directory

Let’s create a dedicated directory for Excalidraw:

mkdir -p /opt/excalidraw
cd /opt/excalidraw

Step 6: Create the Docker Compose File

Create the Docker Compose configuration:

nano docker-compose.yml

Paste the following content:

services:
  excalidraw:
    image: excalidraw/excalidraw:latest
    container_name: excalidraw
    restart: unless-stopped
    ports:
      - "127.0.0.1:5000:80"

What this configuration does

  • Pulls the official Excalidraw image

  • Runs Excalidraw in one Docker container

  • Exposes Excalidraw only on localhost (127.0.0.1) for better security

  • Automatically restarts the container after crashes or reboots


Step 7: Start Excalidraw

Now let’s start the container in detached mode:

docker compose up -d

Confirm the container is running:

docker ps

Test Excalidraw locally:

curl -I http://127.0.0.1:5000

If we get a 200 OK or 302 response, Excalidraw is running correctly.


Step 8: Install and Enable Nginx

Next, we’ll install Nginx:

apt install nginx

Enable Nginx to start at boot and start it now:

systemctl enable nginx
systemctl start nginx

Step 9: Configure Nginx Reverse Proxy (Using IP)

Create an Nginx site configuration file:

nano /etc/nginx/sites-available/excalidraw

Paste the following configuration:

server {
    listen 80 default_server;
    server_name _;

    location / {
        proxy_pass http://127.0.0.1:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
    }
}

Step 10: Enable the Nginx Site

Enable the site by creating a symbolic link:

ln -s /etc/nginx/sites-available/excalidraw /etc/nginx/sites-enabled/

Test the Nginx configuration:

nginx -t

Reload Nginx to apply changes:

systemctl reload nginx

Step 11: Access Excalidraw via IP

Finally, open a browser and visit:

http://YOUR_SERVER_IP

We should now see Excalidraw running successfully.


Conclusion

We’ve successfully installed Excalidraw on Debian 12 using Docker, and exposed it publicly using Nginx reverse proxy, without needing a domain name.

This setup is:

  • lightweight

  • secure (Excalidraw only listens on localhost)

  • easy to manage (Docker auto restart)

If we want to secure the site later, we can add SSL using Let’s Encrypt. But for an IP-based setup, HTTP is enough for basic access.

Share this Doc

Install Excalidraw on Debian 12 with Docker + Nginx

Or copy link

CONTENTS