TL;DR - One Command Install
If you just want to try LogFleet locally with Docker Compose:
# Clone and run the edge stack
git clone https://github.com/logfleet/logfleet.git
cd logfleet/deploy/docker
docker-compose up -d
This starts:
- Vector (log collector) on port
8080
- Loki (log storage) on port
3100
- Grafana (visualization) on port
3000
Send a test log:
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{"message": "Hello from LogFleet!", "level": "info"}'
View it in Grafana at http://localhost:3000 (admin/admin).
Production Setup
For production deployments with cloud connectivity, follow these steps:
Prerequisites
- A LogFleet account (sign up here)
- Docker or Kubernetes on your edge device
- Basic familiarity with REST APIs
Step 1: Create Your Account
Register
Create a new organization and admin account:curl -X POST https://api.logfleet.io/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"organization_name": "Acme Corp",
"email": "[email protected]",
"password": "SecureP@ssw0rd!",
"name": "John Doe"
}'
Password must be at least 12 characters with uppercase, lowercase,
digit, and special character.
Save Your Token
The response includes your JWT token:{
"token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 86400,
"user": { "id": "...", "email": "[email protected]" },
"organization": { "id": "...", "name": "Acme Corp" }
}
Export it for the following steps:export TOKEN="eyJhbGciOiJIUzI1NiIs..."
Step 2: Create an API Key for Edge Agents
Edge agents authenticate with API keys, not JWT tokens.
curl -X POST https://api.logfleet.io/api/v1/api-keys \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Edge Agents",
"permissions": ["edge:register", "edge:heartbeat", "edge:metrics", "edge:stream"]
}'
Response:
{
"api_key": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Edge Agents",
"key_prefix": "lf_prod_"
},
"raw_key": "lf_prod_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456"
}
Save the raw_key now! It’s only shown once and cannot be retrieved later.
export API_KEY="lf_prod_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456"
Step 3: Deploy the Edge Agent
Run the LogFleet edge agent on your device:
docker run -d \
--name logfleet-agent \
-e LOGFLEET_API_KEY=$API_KEY \
-e LOGFLEET_API_URL=https://api.logfleet.io \
-e AGENT_NAME="edge-location-01" \
-v /var/log:/var/log:ro \
logfleet/edge-agent:latest
The agent will:
- Register itself with LogFleet
- Start collecting logs from
/var/log
- Send periodic heartbeats
- Extract and forward metrics
Step 4: Verify Connection
Check that your agent is online:
curl -X GET https://api.logfleet.io/api/v1/agents \
-H "Authorization: Bearer $TOKEN"
Response:
{
"agents": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "edge-location-01",
"status": "online",
"last_heartbeat_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
Step 5: Stream Logs (Optional)
Start a real-time log stream from your agent:
# Start streaming session
curl -X POST https://api.logfleet.io/api/v1/stream/start \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"timeout_seconds": 300
}'
Then connect to the WebSocket URL in the response to receive logs.
Next Steps