Headless servers and the command line

Nyx Backup does not need a desktop. The background service does all the work, and two terminal tools talk to it. Both work over SSH:

  • nyx_bkp_tui - a full-screen terminal interface. It does first-time setup, creates and edits backup sets, starts, pauses and cancels backups, browses snapshots and restores from them, and shows the live log.
  • nyx_bkp_cli - the command line. The same day-to-day work as one-line commands, for quick checks and for scripts.

Both are on your PATH after install: /usr/bin on Linux, /usr/local/bin on macOS, and the install folder on Windows.

1. Install

On 64-bit ARM Linux (ARM servers and single-board computers) install the -headless package. It holds the service and the two terminal tools, with no desktop libraries. It needs a 64-bit (arm64 / aarch64) operating system: on a Raspberry Pi that means the 64-bit Raspberry Pi OS, as the 32-bit image cannot run it.

sudo apt install ./NyxBackup-<version>-arm64-headless.deb     # Debian, Ubuntu, Raspberry Pi OS
sudo dnf install ./NyxBackup-<version>-aarch64-headless.rpm   # Fedora, RHEL and similar

On x86-64 Linux install the regular .deb or .rpm. There is no separate headless build for x86-64: the regular package runs fine on a server with no desktop, it just brings the desktop libraries along.

The service starts at once and at every boot. Check it with:

systemctl status nyx-backup

Raspberry Pi

A Raspberry Pi 4 or 5 runs the headless package, on the 64-bit Raspberry Pi OS (uname -m says aarch64; the 32-bit system cannot run it). It is tested on a Pi 4 with 4 GB and Raspberry Pi OS on Debian 13. Install it as above, then set it up over SSH with the steps below. Two things are worth knowing:

  • Keep big data off the SD card. SD cards are slow and wear out. Put the files you back up on a USB SSD when they are more than a few gigabytes, and send the backups to another disk or to cloud storage, never to the same card.
  • Expect the speed of its storage. A backup with nothing changed takes a few seconds.

A Pi that already runs its services in Docker can use the NAS image instead; its compose file works on a Pi as it is.

2. Decide which account owns it

Nyx Backup on a computer belongs to one account - the one that does the first-time setup. Only that account (plus root, or an administrator on Windows) can open its backups, change its sets, restore, or export the key. Every other account is refused. See Permissions and ownership for what restores can and cannot write.

Pick the account before you start:

  • Run everything with sudo if the server is administered as root. Setup done with sudo makes root the owner, and every command afterwards needs sudo too.
  • Run as an ordinary account if you want to use it without sudo. Log in as that account and do the setup there. The service still runs as root, so it can back up the whole system either way.

You can change your mind later. Root can hand ownership to another account (from 1.0.6):

sudo nyx_bkp_cli set-owner alice

3. First-time setup

Start the terminal interface as the account that will own it:

nyx_bkp_tui          # or: sudo nyx_bkp_tui

The first screen creates your encryption key: press G to generate a new key, or I to import one you already use on another computer. You then see your recovery passphrase once. Write it down and store it away from this server: it is the only way to decrypt your backups if this machine is lost. Press s to save it to a file if you would rather copy it off the server that way, then delete the file once it is somewhere safe.

4. Create a backup set

In the terminal interface, press 4 for Settings, then a to add a set.

  • Tab and Shift+Tab move between fields.
  • On the source paths field, F2 opens a folder picker.
  • F3 tests the storage connection before you save.
  • Enter saves the set; Esc leaves without saving.

Choose a destination that signs in with a key or password: Amazon S3 or any S3-compatible service, Backblaze B2, Wasabi, Azure Blob, Google Cloud Storage, SFTP, SMB, WebDAV, or a local or attached disk. Google Drive, Dropbox and OneDrive sign in through a web browser and are easiest to set up from the desktop app. See Connecting storage for each one.

The set editor also holds the schedule, retention, hooks and the “dead-man’s switch” ping URL described in Monitoring and alerts, which is the simplest way to find out when a server has stopped backing up.

Other keys: 1 to 6 jump between tabs, 2 shows the live log, and q quits.

5. Back up and restore from the terminal interface

Dashboard (1), for the selected set:

  • b backs up now, f re-reads every file rather than only changed ones.
  • p pauses a running backup, r resumes it, x cancels it.

Snapshots (3):

  1. Choose a snapshot, then press r to restore all of it - or press Enter to browse its files, tick the ones you want with Space, and press r.
  2. Choose where to: d for your desktop folder, or c to type a folder. o also restores the original owners and permissions, which needs root.
  3. Press Enter to start. Progress shows on the same screen.

6. Activate your license

nyx_bkp_cli license activate ./nyxbackup.lic
nyx_bkp_cli license status

The license verifies offline.

7. Day-to-day commands

Set names with spaces need quotes. A set’s id works anywhere a name does.

TaskCommand
Show every set and its last runnyx_bkp_cli status
Back up nownyx_bkp_cli backup "Server"
Re-read every file, not just changed onesnyx_bkp_cli backup "Server" --full
Cancel, pause or resume a runnyx_bkp_cli cancel-backup "Server" (also pause-backup, resume-backup)
List snapshotsnyx_bkp_cli snapshots "Server"
Find a file in every snapshotnyx_bkp_cli search "nginx.conf" (add --set "Server" to narrow it)
Restore everything from the latest snapshotnyx_bkp_cli restore "Server" /srv/restore-test
Restore one folder from one snapshotnyx_bkp_cli restore "Server" /srv/restore-test --source /etc/nginx --snapshot SNAPSHOT_ID
Restore with the original owners and permissionssudo nyx_bkp_cli restore "Server" /srv/restore-test --preserve-owners
Check the destination still has every pack, without downloading anything (exit code 2 if not)nyx_bkp_cli quick-audit --set "Server"
Check stored data can be read and decryptednyx_bkp_cli integrity --set "Server"
Preview, then run, the clean-up of unused datanyx_bkp_cli cleanup --set "Server" --dry-run, then without --dry-run (before 1.0.7 the command was gc, which still works)
Pause scheduled backups for maintenancenyx_bkp_cli maintenance --hours 6 (--clear ends it)
Limit bandwidthnyx_bkp_cli bandwidth --upload 20 (Mbps; --clear removes it)
Check your personal exclusion filesnyx_bkp_cli exclusions-check
Save a copy of the encryption keynyx_bkp_cli export-key --output /root/nyxbackup-master.key
Check for and install an updatenyx_bkp_cli check-update, then nyx_bkp_cli update --yes
Change who owns itsudo nyx_bkp_cli set-owner alice

A restore never overwrites an existing file unless you ask: --overwrite skip (the default) leaves it, --overwrite replace replaces it, and --overwrite rename keeps both. --resume picks up an interrupted restore. Run nyx_bkp_cli help restore - or help with any command - for the full list of options.

8. Scripting and automation

  • JSON output. Put --json before the command for machine-readable output: nyx_bkp_cli --json status.
  • Exit codes. 0 success, 1 the service is not running or this account cannot reach it, 2 any other error (including a refusal from the service), 3 the license is invalid or expired.
  • Restore password. If a set has a restore password, give it without a prompt through --password-file PATH (first line of the file), --password-stdin, or the NYX_RESTORE_PASSWORD environment variable. Never put it on the command line, where other accounts can see it.
  • Scheduled backups need no cron job. Each set’s own schedule runs them. Use cron or a systemd timer only if you want something the set schedule cannot express.

9. Logs and troubleshooting

  • The service log is /var/log/nyxbackup/nyx_bkp_service.log on Linux and macOS (C:\ProgramData\NyxBackup\logs\ on Windows). On Linux it also goes to the journal: journalctl -u nyx-backup -f.
  • The terminal interface’s Logs tab (2) shows the same log live.
  • If a command says this account is not permitted to use Nyx Backup, the service is running but belongs to another account: run the command as the owner, or hand it over with sudo nyx_bkp_cli set-owner NAME.
  • If it says the service is not running, start it with sudo systemctl start nyx-backup and look at the log above for why it stopped.

More in Troubleshooting.