Install the server
Build shellgraph-server, make the master key, then start the server behind TLS.
Before you start
- To build: Go 1.27, Node.js 24, pnpm 11, and Podman for the image.
- To run: one Linux machine (amd64 or arm64), or a container runtime.
- An LDAP directory or an OIDC identity provider for the login. The server has no local users.
Build
Clone the repository and go to it.
git clone https://git.rda.run/shellgraph/server.git cd serverBuild the binary. The UI is in the binary.
make buildThe result is
bin/shellgraph-serverforlinux/amd64. For arm64, usemake build ARCH=arm64.Optional: build the container image
shellgraph-server:<version>.make image
The binary is compiled for x86-64 v3 (AVX2, all CPUs since 2013). For an older CPU, use make build GOAMD64=v2.
Make the master key
The server encrypts the SSH private keys with a master key. Without the master key, the server cannot read the credentials.
Make a key.
shellgraph-server keygenKeep the key in a safe place.
Put the key in the environment variable
SHELLGRAPH_KEYof the server.
Configure the login
Configure LDAP, OIDC, or both, before the first start. If no login method is configured, the server does not start.
Start the server
Set the variables.
export SHELLGRAPH_KEY='<key>' export SHELLGRAPH_ADMIN_GROUP=shellgraph-admins export SHELLGRAPH_OIDC_ISSUER=https://id.example.net export SHELLGRAPH_OIDC_CLIENT_ID='<client ID>' export SHELLGRAPH_OIDC_CLIENT_SECRET='<client secret>'Start the server.
shellgraph-server serve --db /var/lib/shellgraph/shellgraph.db --listen :8080
If a variable is missing or not valid, the server prints the problem and stops. For all flags and variables, see Command line and Environment variables.
Run in a container
The image has only the binary. It runs as the user 10001 and keeps the database in the volume /data.
Put the variables in a file, one
NAME=valueon each line, for example/etc/shellgraph/env.Make the file readable only by root. It contains the master key and the login secrets.
chmod 600 /etc/shellgraph/envStart the container.
podman run -d --name shellgraph -p 8080:8080 --env-file /etc/shellgraph/env -v shellgraph-data:/data shellgraph-server:<version>
Use TLS
Use HTTPS between the collectors and the server. Do one of these:
- Start the server with
--tls-certand--tls-key. - Put a reverse proxy with TLS in front of the server. The proxy must send the header
X-Forwarded-Proto: https. SetSHELLGRAPH_PUBLIC_URLto the public URL, so that the OIDC callback and the map links are correct.
The collector refuses an http:// server URL, except for localhost and 127.0.0.1. Security gives the reason.
Do a health check
curl https://shellgraph.example.net/healthz
The server returns {"status":"ok","version":"<version>"}.
Back up
Back up the database file and the master key to different places.
Make a copy of the database. The database uses WAL mode, so do not copy the file while the server runs. Use the SQLite backup command, or stop the server first.
sqlite3 /var/lib/shellgraph/shellgraph.db ".backup /backup/shellgraph.db"Keep the master key in a different place, for example a password manager.