Skip to content

Install the agent on Linux ​

The agent runs as a systemd service on each server you want to monitor.

Requirements ​

  • A 64-bit Linux distribution with systemd: Ubuntu, Debian, RHEL, Rocky, Alma, Amazon Linux, SUSE and others.
  • An x86_64 (amd64) or arm64 CPU.
  • curl and a user with sudo.
  • Outbound HTTPS (port 443) to logcore.lsofito.com. You don't need to open any inbound ports.
  • A Logcore API key. You'll find your keys under Settings → Agent API keys.

One-line install ​

The easiest way to get the command is from the dashboard: open Add server → Linux, pick an API key and optional tags, then copy it. It looks like this:

sh
LOGCORE_API_KEY=lc_xxxxxxxx LOGCORE_TAGS="env:prod,role:web" \
  bash -c "$(curl -fsSL https://logcore.lsofito.com/install.sh)"

The installer:

  1. Detects your CPU, downloads the matching agent from Logcore and verifies its SHA-256 checksum.
  2. Installs the binary as /usr/bin/logcore-agent.
  3. Creates a logcore-agent system user in the adm and systemd-journal groups, so it can read /var/log.
  4. Writes /etc/logcore-agent/logcore.yaml with your server, API key, hostname and tags. Optional settings are included, commented out.
  5. Creates /etc/logcore-agent/services/ with example files: nginx.yaml.example, syslog.yaml.example and myapp.yaml.example.
  6. Installs and starts the logcore-agent systemd service.

Within a minute the server shows up under Infrastructure with its metrics.

Options

You can also set the hostname, enable APM, run the agent as root, and more. See Installer options.

Verify the installation ​

sh
sudo logcore-agent status          # full health report
systemctl status logcore-agent     # systemd's view
sudo journalctl -u logcore-agent -f  # the agent's own log

status should show Status: Running and Connection: OK. If it doesn't, see Troubleshooting.

Collect logs ​

Right after installation, the agent sends host metrics only. To send log files, add a service file:

sh
sudo tee /etc/logcore-agent/services/nginx.yaml >/dev/null <<'EOF'
name: nginx
path: /var/log/nginx/*.log
EOF
sudo logcore-agent configcheck && sudo systemctl restart logcore-agent

Read Custom log files for every option.

Logs outside /var/log ​

The agent runs as the logcore-agent user, which can read /var/log but not your application folders. Give it read access with an ACL:

sh
sudo setfacl -R -m u:logcore-agent:rX /opt/myapp/logs     # existing files
sudo setfacl -R -d -m u:logcore-agent:rX /opt/myapp/logs  # files created later

Every parent folder must also be traversable, which means it needs x permission for the agent user or for "others". Alternatively, reinstall with LOGCORE_RUN_AS_ROOT=true so the agent can read everything.

Manual installation ​

Use this method if the server can't download install.sh, or if you deploy with Ansible, Puppet or golden images.

sh
# 1. binary (pick amd64 or arm64)
curl -fsSLo logcore-agent https://logcore.lsofito.com/downloads/logcore-agent-linux-amd64
sudo install -m 0755 logcore-agent /usr/bin/logcore-agent

# 2. folders and config
sudo mkdir -p /etc/logcore-agent/services /var/lib/logcore-agent
sudo tee /etc/logcore-agent/logcore.yaml >/dev/null <<'EOF'
agent:
  server: "https://logcore.lsofito.com"
  api_key: "lc_xxxxxxxx"
  tags: ["env:prod"]
EOF
sudo chmod 640 /etc/logcore-agent/logcore.yaml

# 3. service
sudo logcore-agent service install
sudo logcore-agent service start
sudo logcore-agent status

A service installed this way runs as root. If you write your own systemd unit instead, use ExecStart=/usr/bin/logcore-agent run -config /etc/logcore-agent/logcore.yaml.