Agent Deployment
The EasyShell Agent is a lightweight Go binary that runs on each managed host. It handles script execution, metrics collection, and real-time log streaming.
Features
Section titled “Features”- Single binary — No runtime dependencies, simple deployment
- Cross-platform — Linux (amd64, arm64), macOS
- Low overhead — Typically under 20 MB memory usage
- Auto-registration — Agents automatically register with the server on first start
- Self-healing — Automatic reconnection on network interruptions
Installation
Section titled “Installation”Automatic Deployment (Recommended)
Section titled “Automatic Deployment (Recommended)”The easiest way to deploy agents is through the EasyShell web interface:
- Go to Host Management → Add Host
- Select Automatic Deployment
- Enter the target host’s SSH credentials (IP, port, username, password/key)
- The server will SSH into the target, upload the correct binary (amd64/arm64), and start the agent
Extract from Docker Image
Section titled “Extract from Docker Image”Agent binaries are bundled inside the server Docker image. You can extract them:
# Extract amd64 binarydocker cp $(docker create --rm laolupaojiao/easyshell-server:latest):/opt/easyshell/agent-binaries/easyshell-agent-linux-amd64 ./easyshell-agentchmod +x ./easyshell-agentPre-built Binaries (GitHub Releases)
Section titled “Pre-built Binaries (GitHub Releases)”Build from Source
Section titled “Build from Source”cd easyshell-agentGOOS=linux GOARCH=amd64 go build -o easyshell-agent-linux-amd64 ./cmd/agentRequires Go 1.24+.
Configuration
Section titled “Configuration”The agent is configured via environment variables or a configuration file:
| Variable | Default | Description |
|---|---|---|
EASYSHELL_SERVER_URL | http://localhost:18080 | Server API endpoint |
EASYSHELL_AGENT_NAME | hostname | Display name for the agent |
EASYSHELL_HEARTBEAT_INTERVAL | 30s | Heartbeat frequency |
EASYSHELL_METRICS_INTERVAL | 60s | Metrics reporting frequency |
Running as a Service
Section titled “Running as a Service”Create a systemd service for the agent:
[Unit]Description=EasyShell AgentAfter=network-online.targetWants=network-online.target
[Service]Type=simpleExecStart=/usr/local/bin/easyshell-agentRestart=alwaysRestartSec=5Environment=EASYSHELL_SERVER_URL=https://easyshell.example.com
[Install]WantedBy=multi-user.targetsudo systemctl daemon-reloadsudo systemctl enable easyshell-agentsudo systemctl start easyshell-agentCommunication Protocol
Section titled “Communication Protocol”The agent communicates with the server using two protocols:
- HTTP — Registration, heartbeat (30s interval), metrics reporting (60s interval), configuration polling
- WebSocket — On-demand connections for real-time log streaming during script execution and interactive terminal sessions
Verifying Agent Status
Section titled “Verifying Agent Status”After starting the agent, verify it appears in the EasyShell web interface:
- Navigate to Host Management
- The new agent should appear with a green status indicator
- Click the host to view real-time metrics
If the agent does not appear, check the agent logs:
journalctl -u easyshell-agent -f