Systemd service¶
The installer picks the right binary for the host, writes a config file, creates the user groups, and installs a systemd unit.
-
Run the installer.
curl -fsSL https://raw.githubusercontent.com/srl-labs/clab-api-server/main/install.sh | sudo bash -s -- installIt creates:
/usr/local/bin/clab-api-server/etc/clab-api-server/clab-api-server.env, with a randomJWT_SECRET/etc/systemd/system/clab-api-server.service- the groups
clab_apiandclab_admins, if missing
-
Review the config. At least set
API_SERVER_HOSTto the name or address clients use to reach this host.All settings are listed in the configuration reference.
-
Let users in.
-
Start the service.
Tip
install --start enables and starts the service right away with the generated defaults. Restart it after you edit the config file.
The service runs as root: it controls the container runtime, network namespaces, Linux users, and lab files.
Behind a proxy¶
Export the proxy variables and keep them for the installer with sudo -E:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1
curl -fsSL https://raw.githubusercontent.com/srl-labs/clab-api-server/main/install.sh | sudo -E bash -s -- install
The service needs them too: add HTTP_PROXY, HTTPS_PROXY, and NO_PROXY to /etc/clab-api-server/clab-api-server.env and restart it.
Store labs outside home directories¶
By default each user's topologies live in ~/.clab/. To keep them elsewhere, set an absolute path:
Files then go to /var/lib/containerlab/labs/<username>/. ~ is not expanded, because the service runs as root on behalf of many users.