Examples
A collection of typical workflows. They assume a running LCM instance (see Installation).
Onboard a server and update it daily
Section titled “Onboard a server and update it daily”- Add the onboarding key: Enter the public key from Settings → General
into
~/.ssh/authorized_keysforrooton the target server. - Join: Dashboard → “+ Add server”, enter host/credentials, confirm the host key fingerprint.
- Group: Under Groups, create a group “Production” and assign the server.
- Schedule + rule: Create a schedule “Nightly” with
0 2 * * *, then add a rule of type Update. - Done - the updates run every night and appear as jobs with console output.
Enforce a firewall as a baseline rule
Section titled “Enforce a firewall as a baseline rule”Goal: On all web servers, only 80, 443 (and SSH) are permanently open.
- Create a group “Web servers”, assign the servers.
- New rule: type Firewall, target Baseline rule (Enforce), ports
80,443. - On the next health ping, ufw is checked and - if it deviates - applied. If someone later changes the firewall on the server, the next ping restores the desired state.
Set up a central APT cache
Section titled “Set up a central APT cache”- Install
apt-cacher-ngon the LCM host and setPassThroughPattern: .*inacng.conf(see APT cache). - In LCM under Settings → Repositories → APT cache, enter the URL
http://<host>:3142and click “Test connection”. - Add “Enforce APT cache” as a group rule - all servers in the group route their APT requests through the cache from now on.
Create a backup and restore it on a fresh instance
Section titled “Create a backup and restore it on a fresh instance”- Set
LCM_BACKUP_PASSPHRASEand create a backup under Settings → Backups (or enable an interval). - Download the
.lcmbakand store it safely. - On a new instance, upload the archive under Backups → Restore and apply it (with the same passphrase) - the instance takes over data, keys, configuration and certificate.
Use the API with a read-only key
Section titled “Use the API with a read-only key”For monitoring scripts that may only read:
-
Settings → API keys → create a new key with scope read. The plaintext key (
lcm_…) appears only once - copy it. -
Query using the
X-API-Keyheader:Terminal window curl -s https://<host>:9310/api/v1/servers \-H "X-API-Key: lcm_dein_key" | jq '.[].name' -
Writing requests (POST/PUT/DELETE) are rejected server-side with 403 when using a read key - the key cannot change anything, even in an admin context.
More on endpoints and auth: Frontend & API reference.