You can run Spectron directly on a Linux host as a systemd service. This is appropriate for single-server deployments, edge environments, or situations where container runtimes are not available.
Prerequisites
A Linux host with systemd (Debian, Ubuntu, RHEL, Fedora, or equivalent)
A running SurrealDB instance (local or remote)
An object store endpoint (S3-compatible, GCS, or a local filesystem path)
curlfor downloading the binary
Obtaining spectrond
Self-hosted Spectron is distributed as the container image ghcr.io/surrealdb/spectron:latest. For bare-metal hosts without Docker at runtime, extract the server binary from the image:
Install the spectron client separately if operators need CLI access (same image, or your organisation’s client distribution channel).
Verify:
Creating a dedicated user
Run Spectron as a dedicated non-root user:
Create the data directory for local object storage (skip if using S3 or GCS):
Environment file
Create an environment file at /etc/docs/spectron/env. Restrict its permissions so that only root and the spectron user can read it:
Populate it:
Never commit this file to version control.
systemd service unit
Create the service unit file at /etc/systemd/system/spectron.service:
Enabling and starting the service
Reload systemd to pick up the new unit, then enable and start the service:
Check the service status:
First-run initialisation
On the first run, create the admin management key. Stop the service first to avoid concurrent init operations, or use the spectron init command directly (it is safe to run against a running instance):
Copy the printed management key secret. Store it in a secrets manager or a separately access-controlled file. It is not recoverable.
Log management
Spectron logs to the systemd journal. Use journalctl to view logs:
Systemd's journal handles log rotation automatically. Configure retention limits in /etc/systemd/journald.conf if needed (SystemMaxUse, MaxRetentionSec).
Health check
Verify the service is responding:
Upgrading
Pull the new container image, extract spectrond again (same steps as above), replace /usr/local/bin/spectrond, and restart the service. Schema migrations run automatically on startup.
Firewall
Expose port 9090 only to trusted clients. If Spectron sits behind a reverse proxy, bind the application listener to 127.0.0.1 and expose only the proxy's port externally:
Next steps
Architecture overview – component relationships
Storage and scaling – configuring object store backends
Authentication – key management after initial setup