Clokeep Clokeep Docs
Documentation API Reference
ServersInstall the agent
Servers View as Markdown

Install the agent

Put the Clokeep agent on a Linux server with one command and see it come online.

The Clokeep agent runs on each server you back up. The panel generates the install command for each server, with its own token.

Prerequisites

  • A Linux server on x86_64 (amd64) or arm64, with systemd and curl.
  • Root access on the server. The command runs with sudo.
  • Outbound HTTPS from the server to app.clokeep.com.
  • Outbound access from the server to your storage. The agent uploads backups straight to it.
  • For database plans, mysqldump or pg_dump on the server.
  • Free disk space where the agent stages backups. See Disk space and the work folder.

The panel never connects to your server. The agent opens every connection, so you open no inbound ports.

Install

Add the server

In the panel, open Servers and click New server. Enter a name, such as web-01, and click Create.

The server's page opens. Under Agent status it shows Pending, because the agent has not checked in yet.

Generate the install command

On the server's page, find Install agent on this server and click Generate install command.

The command appears under Run on remote server. Its token is valid for one use, and for 24 hours by default. The panel shows how long it stays valid.

The Install agent on this server section with the Generate install command button

The install section on a new server's page, before you generate the command.

Run the command on the server

Click the clipboard button to copy the command. Open an SSH session on the server and paste it.

The command looks like this. Copy yours from the panel, because it carries your own token.

curl -fsSL https://app.clokeep.com/agent/install.sh | sudo bash -s -- --url 'https://app.clokeep.com' --token 'YOUR_ENROLLMENT_TOKEN'

The command downloads the agent, enrolls it with the panel and starts it as a systemd service. When it finishes, the output reads:

==> Agent installed and started

Check that the server is Online

Reload the server's page in the panel. Agent status shows Online, with the time the agent was last seen.

The agent also reports the server's IP address, operating system, control panel and agent version. They appear on the same page.

An install command works once: after it enrolls, the agent signs in with its own key. Generating a new install command or enrollment token for the server retires any earlier one that was not used.

What the command installs

  • The agent program at /usr/local/bin/clokeep-agent.
  • Its settings at /etc/clokeep-agent.yaml. This file holds the agent's key.
  • Its default work folder at /var/lib/clokeep-agent. See Disk space and the work folder.
  • A systemd service named clokeep-agent, which starts at boot and restarts if it stops.

The agent updates itself after that. To check its version, restart, reinstall or remove it, see Agent updates.

On a server without Plesk or cPanel, the agent restores files into /var/lib/clokeep-restore, and into other folders only once you allow them in its settings. See Restore files, email and databases.

Disk space and the work folder

The agent stages each backup in its work folder, then uploads it:

  • A full Files or Email backup needs room for a full copy of the data plus the archive. An incremental backup copies only the files that changed.
  • A Database backup needs room for the dump plus its archive.
  • An encrypted backup also needs room for a second copy of the archive while it uploads.
  • A Plesk server or cPanel server backup works one hosting account at a time, so it needs that room for the largest account.
  • A restore needs room for the backup and the earlier backups of its chain, each both downloaded and unpacked, at the same time.

To use another disk, an Admin or Operator picks it under Work directory on the server's page and clicks Save changes. The list shows the disks the agent found, with their free space. Auto picks the disk with the most free space at each run. Left empty, the agent uses its default folder. On another disk, the agent works in a .clokeep-agent folder at the disk's root. That folder stays when you choose another place.

Server status

A server's status comes from the agent's last check-in:

  • Online means the agent checked in within the last few minutes.
  • Offline means the agent checked in before but has gone quiet.
  • Pending means the agent has never checked in.

Backups run only while the agent checks in.

Troubleshooting

The command stops after Checking panel connectivity

The server fetched the install script, but it could not download the agent from the panel.

The installer downloads the agent, and later enrolls it, at the address after --url. Check that it reads 'https://app.clokeep.com', exactly as the panel shows it. Copy the command from the panel again if you edited it.

If the address is right, the server cannot reach the panel at that address.

enrollment failed: connection refused

The agent could not reach the panel when it tried to enroll. Check the address after --url as for the previous error. If it is right, the panel cannot be reached from the server.

enrollment failed: api error 401

The full message reads enrollment failed: api error 401: Invalid or expired enrollment token. The token in the command has expired or was used already. On the server's page, click Regenerate next to the command, or Generate install command, and run the new command.

Unsupported architecture

The agent runs on x86_64 (amd64) and arm64 servers only.

clokeep-agent did not start

The agent was installed but its service did not stay up. Read its log on the server:

journalctl -u clokeep-agent
load config failed

The agent cannot read /etc/clokeep-agent.yaml, usually because it never enrolled. Generate a new install command in the panel and run it on the server.

The server stays Pending or turns Offline

The agent is not checking in. Check that its service is running:

sudo systemctl status clokeep-agent

If it is stopped, start it again:

sudo systemctl restart clokeep-agent

If it runs but the server stays Offline, check that the server can reach the panel:

curl -s -o /dev/null -w '%{http_code}\n' https://app.clokeep.com/agent/install.sh

The command prints 200 when the server reaches the panel. It prints 000 when the server cannot reach the panel. Any other code means the server reached something that did not answer as the panel does, so check the address.

Backups stay Queued

A run waits as Queued until the server's agent picks it up. Check that the server shows Online. If it does not, follow the steps for a server that stays Pending or Offline.

Next steps

Esc
↑↓to navigate↵to openEscto close