8. Remote daemon

Manage Saba-chan running on another PC or a Linux server from the app and CLI on the PC in front of you.

8. Remote daemon

If you keep game servers running on a separate machine (another PC at home, a cloud server, a Linux server), you can manage that machine's Saba-chan from the app and CLI on the PC in front of you. This is called a remote daemon. When you pick a remote daemon, the server list, start and stop, console, settings and backups all work on that machine.

This chapter calls the two PCs:

NameRole
Server PCThe PC where the game servers run. Other PCs connect to it
Your PCThe PC you are sitting at. It connects to the server PC and manages it

How the connection works

  • Both PCs must finish Discord with the same Discord account. Only PCs connected to the same account can pair. You cannot connect to someone else's PC.
  • When pairing, Saba-chan Cloud hands your PC the server PC's address and certificate fingerprint. From then on your PC connects straight to the server PC over an encrypted connection (TLS).
  • The server PC's public IP is published automatically as Saba-chan Cloud sees it. If the remote port is open, your PC connects to that address directly; if it cannot be reached (behind a router, no port forwarding possible), it connects through Saba-chan Cloud. The encryption is still between the two PCs; it is only a little slower, and everything works the same. The route through Saba-chan Cloud is used only for the first pairing and when a direct connection fails.

Step 1: Allow remote connections on the server PC

  1. Connect the server PC's Saba-chan to Discord. Skip this if it is already connected.
  2. In Settings → Connection → Remote daemon, check that Allow remote connections is on. It is on from the start; if you turned it off earlier, turn it on again. Only PCs connected to the same Discord account can be paired.
  3. Port is 57480 by default. Change it only if another program already uses that number.
  4. Address is optional. Leave it empty to publish the public IP Saba-chan Cloud sees, or enter another public IP or host name. For a direct connection, open this port (TCP) on the server PC's router and firewall. Without it, your PC still connects through Saba-chan Cloud.
  5. Press Save. When the status changes to Listening on port 57480 and then Your other PCs know about this PC, it is ready.

For a Linux server without a screen, follow Install on a Linux server below.


Step 2: Connect from your PC

  1. Connect Saba-chan on your PC to the same Discord account.
  2. Open Settings → Connection → Remote daemon. My PCs shows a card for this PC (outlined) and for your other PCs on the same account. Each card shows the OS, paired date, last seen, public IP and remote route. If the server PC's card shows Not open for remote connections, Step 1 is not finished yet.
  3. Press Connect on the server PC's card. When it is done, the card shows the paired date and an Open button. The route shows Direct (port …) for a direct connection, or Through Server-chan through Saba-chan Cloud. Connecting turns on auto-update for that PC.

If you see That PC is not open for remote connections, check Step 1. If you see Could not reach the remote daemon, check that the server PC and its Saba-chan are running.


Step 3: Pick a daemon

Once you have at least one remote daemon, a Daemon picker appears in the app's top bar.

  • Pick This PC or a remote daemon's name, and the whole app works on that daemon. Switching closes any detached console windows.
  • When you create a server or choose a path on a remote daemon, a window showing that PC's folders opens (Choose a folder on the remote PC).
  • What you do remotely is recorded in the server PC's Log tab as Remote PC with your PC's name.

Remote daemons appear as Discord name (PC name). You choose the daemon to look at first when you open the app as the main daemon. Press the star on a card to make that PC the main daemon; the main daemon's star is filled in yellow. Picking another daemon for a moment in the top bar does not change the main daemon.

Choose the list layout in Server list (Settings → Connection → Remote daemon).

ChoiceWhat you see
Chosen daemon onlyOnly the servers of the daemon picked in the top bar
All daemons combinedBelow the picked daemon's servers, the servers of the other daemons (including this PC), grouped by daemon. You can start and stop them right there, and Open this daemon switches to that daemon

What you cannot do remotely

These always belong to the PC the app is running on, even with a remote daemon picked. Trying them remotely shows This can only be done on that PC itself.

  • Update settings and checks for Saba-chan (remote PCs get auto-update when you connect them and update on their own. If one is older than this PC, press Update on its card, or use /saba update in Discord)
  • Start at sign-in, app display settings, remote daemon settings, stopping the daemon
  • The Discord connection and Erase all my data

Managing connections

What you wantWhere
Stop a PC from connectingDisconnect in the server PC's PCs connected to this one list. That PC's key stops working at once
Delete a remote daemonDelete on that PC's card. It always forgets the PC here and tells that PC to unpair. You can also uninstall Saba-chan there (online Linux or macOS; settings and game server files can be kept) and remove it from your PCs on the relay. Press Connect again to use it again
Update a remote PCPress Update when it shows on the card (the PC is older than this one)
Rename or remove a PC/saba my-pcs in Discord. It lists every PC connected to your account

Install on a Linux server

On a Linux server without a screen (x86_64) you install only the daemon and the CLI. You use the app screens from Saba-chan on a Windows PC, through the remote daemon.

Install from the app

In the Windows app, open Settings → Connection → Remote daemon, press Install on Linux and enter the Linux PC's address, account and ssh port. The app connects with this PC's ssh, runs the one-line install below, and finishes the Discord pairing and the remote daemon connection. The host key check, password and sudo password appear as questions in the app; Saba-chan never keeps keys or passwords. You can also choose Keep running after logout (sudo) and 32-bit libraries for Steam games (sudo) here.

If ssh does not work, press No SSH?. Paste the line it shows on that PC, then enter the pairing code from its output in the app to add it as a PC on your account.

Install by hand

  1. Make sure curl, unzip, sha256sum and python3 are installed.
  2. Install with one line:
    curl -fsSL https://raw.githubusercontent.com/WareAoba/saba-chan/main/install.sh | sh
    

    To choose the install folder and the first game modules, add arguments:
    curl -fsSL https://raw.githubusercontent.com/WareAoba/saba-chan/main/install.sh | sh -s -- --dir ~/saba --modules minecraft terraria
    

    The installer downloads the latest stable release, checks the files against the release hashes and its signed manifest, installs it, creates ~/.local/bin/saba-chan-cli, and starts the daemon as a systemd user service (saba-chan.service).
  3. To start it at boot without logging in, run once: sudo loginctl enable-linger $USER (or add --linger to the install command)
  4. Connect to Discord. Run saba-chan-cli bot pair to get a code, then send /saba connect code:… in Discord. A direct message to the bot works too.
  5. Remote connections are on from the start. If the server has a public address, tell Saba-chan with saba-chan-cli remote set --address <address>. Check with saba-chan-cli remote status.
  6. In the app on your Windows PC, press Connect as in Step 2 above.

Good to know:

  • Palworld and Project Zomboid download server files with SteamCMD, which is a 32-bit program and needs 32-bit libraries (for example sudo apt install lib32gcc-s1). Add --steam-libs to the install command to install them with apt or dnf.
  • A game module can state which operating systems it runs on. On other systems the game shows Not on this OS when you create a server, and you cannot create it. Among the official modules, Terraria currently states Linux. Modules that state nothing are not blocked, but not all of them have been checked on Linux.
  • To change the update channel, use for example saba-chan-cli update config channel=beta. The installer uses the stable channel.

From the terminal

What you wantCommand
Remote connection status of this PCsaba-chan-cli remote status
Turn remote connections on or off, change port or addressremote set --on · --off · --port 57480 · --address <address>
See your other PCs · pair with oneremote peers · remote connect <PC id>
Remote daemons this PC uses · forget oneremote daemons · remote forget <PC id>
PCs connected to this one · disconnect oneremote clients · remote revoke <PC id>
Install on a Linux PC over ssh and connect · connect with a pairing coderemote install <user@host> [--port 22] [--linger] [--steam-libs] · remote claim <code>
Delete a remote PCremote remove <PC id> [--uninstall [--remove-settings] [--remove-instances]] [--from-relay]
Update a remote PC · turn auto-update on or offremote update <PC id> · remote update <PC id> --auto on · --auto off
Servers of every daemon at onceremote servers
Send any command to a remote daemon--daemon <name> (the SABA_DAEMON environment variable works too)

For example, saba-chan-cli --daemon linux start terra starts the terra server on the remote daemon called linux.