Skip to main content

Server Guide

Your bridge to the track

The DEJA Server is a small program that runs on the computer connected to your CommandStation. It takes the commands you send from the Throttle, Cloud, and Monitor apps and passes them to your DCC-EX hardware over USB. You set it up once, and it runs quietly in the background while you focus on running trains.

Video walkthrough coming soon

Make sure you've completed the Getting Started guide — your server should be running and your command station connected.

Make sure your DCC-EX CommandStation is connected via USB to the computer running the server.

01

Meet the deja Server CLI

The DEJA Server comes with a simple command-line tool called deja. Think of it like a remote control for your server — you type a short command, and the server does the rest.

You don't need to be a computer expert to use it. There are only a handful of commands, and they all do exactly what their names say: deja start, deja stop, deja status. That's the kind of thing we're talking about — nothing complicated.

💡

To use these commands, open a terminal on the computer connected to your CommandStation. On a Mac, search for "Terminal" in Spotlight. On a Raspberry Pi or Linux, it's usually in your applications menu. Type the command, press Enter, and you're done.

02

Starting the Server

When you type deja start, the server launches and you'll see a live console scrolling with status updates as it connects to your CommandStation, DEJA Cloud, and any other services.

bash
$deja start
DEJA Server starting up — live console output showing connections being established

This is the default mode — the server runs right in your terminal so you can see exactly what's happening. Press Ctrl+C when you want to stop it.

💡

Want the server to run in the background so you can close the terminal? Add the -b flag: deja start -b

03

View Your Logs

Want to see what the server is doing? Check the logs:

bash
$deja logs

This shows recent activity — connections, commands sent to the track, and any errors. If you want to watch the logs in real time (handy for debugging), add the -f flag:

bash
$deja logs -f

Press Ctrl+C to stop watching. The server keeps running in the background — you're just closing the log viewer.

04

Stop, Start & Restart

You've got three commands for controlling the server. They do exactly what they say:

deja stop

Shut down the server

▶️

deja start

Start it back up

🔄

deja restart

Stop + start in one step

💡

Remember: deja start runs in the foreground by default (you'll see the live console). Add -b to run in the background.

05

Keep It Updated

When a new version is available, updating is one command:

bash
$deja update

This downloads the latest version and restarts the server automatically. All your settings — layout ID, serial port, configuration — are preserved. Nothing to reconfigure.

06

Monitor from Anywhere

Want to check on your railroad when you're not on your home network? The tunnel command creates a secure connection so you can access your server remotely:

bash
$deja tunnel start

This gives you a public URL that connects back to your server. Open it on any device, anywhere — your phone at work, a laptop at a friend's house, wherever.

🔒

Remote access requires an Engineer or Conductor plan. The connection is encrypted and only accessible with your DEJA account credentials.

For the full setup details, see the Remote Accessdocs.

Inside the Server Console

When the server is running in the foreground, you're inside an interactive console. You can type commands right at the prompt — no need to stop and restart. Here's what's available.

Slash Commands

Type a / followed by a command name. You can also press Tab to autocomplete, or type /help to see the full list.

Server

/startStart the server
/stopStop the server and exit
/restart/rRestart the server
/quit/qExit the console (server keeps running)

Navigation

/menu/mOpen the interactive menu
/status/sShow the status panel
/logs/lShow the log view
/ports/pShow serial port selector

Devices

/devices/dShow device dialog and manage connections
/connect/cConnect a device by name
/disconnect/dcDisconnect a device by name

Tools

/help/hShow all available commands
/filter/fCycle log filter (all → error → warn)
/tunnel/tToggle remote access tunnel

The Menu

Type /menu (or just press Esc) to open a visual menu. Use the arrow keys to navigate and Enter to select. It's another way to access everything above without remembering command names.

DCC Commands

You can also type raw DCC-EX commands directly at the prompt — they're sent straight to your CommandStation. For example, type <1> to turn track power on. See the CLI Referencedocs for more details.

Reading the Console Output

Each line in the console follows the same format. Here's what each part means:

message types
[DEJA.JS] › startA service or process is launching
[DEJA.JS] › successSomething connected or completed
[DEJA.JS] › completeA task finished (port opened, layout loaded)
[DEJA.JS] › noteConfiguration detail or status update
[DEJA.JS] › infoSomething happened, no action needed
[DEJA.JS] › starA DCC command was sent to the track
[DEJA.JS] › warnNon-critical issue — server keeps running
[DEJA.JS] › errorSomething went wrong
[DEJA.JS] › fatalCritical error — server may need a restart

For a complete guide to every message — startup sequence, DCC commands, shutdown, and common errors — see the Console Output referencedocs.

CLI Quick Reference

The deja CLI is your control panel. Here's every command at a glance:

deja start

Start the server

deja start -b

Start in background

deja stop

Stop the server

deja restart

Restart the server

deja status

Check server status

deja logs

View recent logs

deja logs -f

Follow logs live

deja update

Update to latest version

deja tunnel start

Start remote access

deja tunnel stop

Stop remote access

deja tunnel status

Check tunnel status

deja --version

Show installed version

For the full CLI reference with all options and flags, see the CLI Referencedocs.

Troubleshooting

Server not connecting to CommandStation

1. Make sure the USB cable is plugged in to both the CommandStation and your computer.

2. Run deja status to see if the server detects a serial port.

3. Try deja restart — the server re-scans for devices on startup.

Permission denied on serial port

On Linux and Raspberry Pi, your user needs permission to access serial devices. Run this once:

bash
$sudo usermod -a -G dialout $USER

Then log out and back in (or reboot) for the change to take effect.

Server won't start

1. Check that Node.js 20+ is installed: node --version

2. Check the logs for error details: deja logs

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

Still stuck? Check the Troubleshootingdocs or reach out on Discord.

What's Next?

Your server is up and running — here's where to go from here.