Skip to main content

DEJA Server

The DEJA Server is the bridge between your browser and your DCC-EX CommandStation hardware. It runs in the background on the computer connected to your CommandStation via USB, translating commands from the Throttle, Cloud, and Monitor apps into DCC-EX serial commands on the track.

How It Works

You control your trains from a web browser — your phone, a tablet, your laptop. Those commands travel through the cloud to the DEJA Server, which talks to your CommandStation over USB. The server handles everything in between so you can focus on running your railroad.

The server manages:

  • WebSocket connections — real-time communication with your browser apps
  • Firebase sync — cloud-based layout data (throttles, turnouts, effects, signals)
  • Serial communication — USB connection to your DCC-EX CommandStation at 115200 baud
  • MQTT messaging — optional communication with wireless IoT devices (deja-esp32-wifi, deja-mqtt Pico W)
  • Sound playback — layout sound effects played through the server's speakers

Getting Started

The fastest way to get up and running is the Server Guide — a step-by-step walkthrough from installation to your first train.

If you're already set up and looking for reference material, use the pages in this section:

PageWhat it covers
InstallationPlatform requirements, one-command install, what the installer does
CLI ReferenceEvery deja command with flags and examples
ConfigurationEnvironment variables, config files, directory layout
Remote AccessSecure tunnel for monitoring from anywhere
TroubleshootingCommon issues and how to fix them

Quick Install

macOS / Linux / Raspberry Pi:

curl -fsSL https://install.dejajs.com | bash

The installer downloads the server, detects your CommandStation's serial port, and starts the server automatically. See Installation for the full details.

Managing with the deja CLI

CommandWhat it does
deja statusCheck if the server is running, your subscription, and serial connection
deja logsView recent server logs
deja logs -fFollow server logs in real time
deja startStart the server
deja stopStop the server
deja restartRestart the server
deja updateDownload and install the latest version

See the CLI Reference for the complete command list with flags and examples.