Self-Host OrcaSlicer Without VNC: Inside PancakeSlicer's Docker and Web UI Architecture

By Zimeng Xiong on

When people try to self-host OrcaSlicer, they usually run into two imperfect options: streaming the full wxWidgets desktop binary inside a virtual X11 display over KasmVNC or Selkies (such as linuxserver/orcaslicer or Kasm Workspaces), or compiling the slicer to WebAssembly to run inside a browser tab (slicers.wasm). PancakeSlicer takes a third route: a native React and WebGL2 web UI backed by a Go HTTP server that spawns OrcaSlicer's headless C++ engine as isolated child processes inside a single FROM scratch Docker container.

Why VNC streaming and WebAssembly fall short for a homelab slicer

Streaming a desktop GUI to a browser creates friction every time you slice a part. Scrolling, pinch-to-zoom, clipboard paste, file uploads, and high-DPI text all pass through a video stream and virtual input layer, making iPads and laptops uncomfortable to use. One desktop window holds one active plate, so two tabs fight over the same cursor and state. The container ships an X server, window manager, and shell, and as linuxserver/orcaslicer notes in its own docs, anyone who reaches the GUI can gain root inside the container. Worse, if a bad STL triggers a C++ crash or memory spike, the entire GUI session dies.

Running OrcaSlicer inside the browser via WebAssembly (slicers.wasm) avoids server CPU usage, but hits the opposite wall: heavy multi-threaded slicing and non-planar collision checks hit browser memory limits on tablets, there is no shared server-side project and profile library across devices, and browsers cannot speak raw TCP, FTPS, or MQTT directly to LAN printers such as Bambu Lab machines without a server-side relay.

Three-layer architecture: Web UI, Go server, isolated C++ engine

PancakeSlicer separates the interface, state management, and slicing compute into three layers packaged inside one Docker container (and reused identically in the Windows, macOS, and Linux desktop apps):

LayerRuntimeWhat it handles
Web UIBrowser (WebGL2, Chrome/Edge 109+, Firefox 115+, Safari 16.4+)3D plate viewport, G-code preview, dynamic profile UI, CodeMirror G-code editor, version history, and printer controls.
ServiceGo HTTP serverAPI, persistent projects and profiles in /data, dynamic profile resolution, job queue, SSE telemetry, auth, and direct send to 8 printer ecosystems.
Slicing engineOrcaSlicer-derived C++ engineSTL, OBJ, 3MF, and STEP mesh operations, planar and non-planar slicing, print-head collision checking, and G-code or .gcode.3mf output.

Why isolated child processes beat in-process slicing

Early builds linked OrcaSlicer's C++ engine directly into Go via CGo. In practice, in-process slicing led to stalls, shared global-state bugs across concurrent slices, and whole-server crashes whenever a malformed mesh triggered an assertion or segfault.

Spawning the C++ engine as a separate short-lived child process per slice fixed all of those issues. Each job gets its own scratch directory under /data/jobs and a 15-minute wall-clock timeout (ORCA_WEB_JOB_TIMEOUT). As soon as a slice finishes or fails, the OS reclaims every byte of its C++ memory. Concurrency is capped by ORCA_WEB_MAX_JOBS (2 by default), queueing extra slices cleanly so a busy makerspace or small Raspberry Pi never runs out of RAM. Process startup adds roughly 0.2 seconds on average, while a disposable stage cache under /data/jobs/stage-cache (capped at 1024 MB via PANCAKE_STAGE_CACHE_MAX_MB) reuses intermediate non-planar geometry across re-slices.

Live progress and printer telemetry over Server-Sent Events

Instead of polling or running a separate WebSocket server, the Go backend streams slice progress, workspace revisions, and active printer transfer status over standard HTTP Server-Sent Events. The server disables proxy buffering (X-Accel-Buffering: no), pushes live transfer updates every 250 ms while a print is uploading, and sends a 1-second keepalive heartbeat. Putting Caddy or Nginx in front only requires unbuffered streaming (flush_interval -1 in Caddy) and a long upstream timeout for heavy slices.

Minimal FROM scratch multi-arch container

PancakeSlicer publishes native linux/amd64 and linux/arm64 images to Docker Hub (zimengxiong/pancakeslicer) and GHCR (ghcr.io/zimengxiong/pancakeslicer). The final container starts FROM scratch with only the Go server, the C++ engine, their exact shared libraries, static web assets, and the corresponding AGPL-3.0 source archive.

There is no shell, no package manager, and no root user inside the container. It runs as non-root UID/GID 65532, exposes port 6868, and stores all state under /data. The bundled Compose files also drop all Linux capabilities, set no-new-privileges:true, and apply an 8 GB memory limit.

LAN-scoped security and authentication

A self-hosted web service that uploads files to printers must avoid becoming an open SSRF proxy. By default, ORCA_WEB_PRINTER_NETWORK=lan restricts printer connections and direct send to private IPv4 and IPv6 LAN ranges (you can narrow it to explicit CIDRs/hostnames or set it to off).

Setting ORCA_WEB_BEARER_TOKEN locks all mutating API routes behind a shared token. Signing in from the browser verifies the token in constant time and stores a signed HttpOnly, SameSite=Strict cookie, paired with same-origin checks. Because there are no built-in user accounts, multi-user households and labs place Authentik, Authelia, Cloudflare Access, or Tailscale in front and set ORCA_WEB_TRUSTED_PROXIES.

One slicer for every printer on your network

Running PancakeSlicer on a home server or NAS gives every laptop and iPad one shared library of dynamic profiles, filaments, and projects, with direct print send to Bambu Lab (LAN .gcode.3mf without Bambu Cloud or Bambu Connect), Klipper (Moonraker), OctoPrint, PrusaLink, Duet (RepRapFirmware), Flashforge (LAN), Elegoo Link (Centauri), and Repetier Server.

Deploy it with the Docker Compose guide to self-host OrcaSlicer, compare alternatives on self-hosted slicers compared, or read how non-planar collision checking works.