Skip to main content

Overview

Lightd is a fast, cross-platform Docker daemon built with Rust and Axum, designed to manage containers without the hassle. It provides a comprehensive REST API and real-time WebSocket interface for container lifecycle management.

Base URL

Default: http://localhost:8070

Key Features

  • Container Management - Full lifecycle control (create, start, stop, restart, reinstall)
  • Volume Management - Persistent storage with file operations and disk quotas
  • Network Pool - Port allocation and management with bulk operations
  • WebSocket Interface - Real-time container monitoring and control
  • Remote Sync - Multi-server synchronization support
  • Resource Limits - CPU and memory constraints with live updates
  • Pattern Detection - Automatic server ready state detection
  • Billing & Usage Tracking - Real-time resource monitoring and cost estimation
  • Container Updates - Live resource updates without downtime
  • SFTP File Access - Built-in SFTP server for secure file transfers

Authentication

All protected routes require Bearer token authentication:
Authorization: Bearer lightd_<your-token>
Accept: Application/vnd.pkglatv1+json
See the Authentication Guide for token management.

Quick Start

1

Get your API token

./lightd --token what
2

Create a volume

curl -X POST http://localhost:8070/volumes \
  -H "Authorization: Bearer lightd_token" \
  -H "Accept: Application/vnd.pkglatv1+json"
3

Create a container

curl -X POST http://localhost:8070/containers \
  -H "Authorization: Bearer lightd_token" \
  -H "Accept: Application/vnd.pkglatv1+json" \
  -H "Content-Type: application/json" \
  -d '{
    "internal_id": "my-server",
    "image": "ubuntu:22.04",
    "volume_id": "your-volume-id",
    "startup_command": "bash",
    "limits": {"memory": 536870912, "cpu": 1.0}
  }'
4

Monitor via WebSocket

const ws = new WebSocket('ws://localhost:8070/ws/my-server?token=lightd_token');
ws.onmessage = (e) => console.log(JSON.parse(e.data));

API Sections

Authentication

Token management and security

Volumes

Persistent storage and file operations

Network

Port allocation and management

Containers

Container lifecycle management

WebSocket

Real-time monitoring and control

Remote Sync

Multi-server synchronization

Billing

Usage tracking and cost estimation

Container Updates

Live resource updates without downtime

SFTP

Secure file access to container volumes

Response Format

Success Response

{
  "success": true,
  "data": { ... }
}

Error Response

{
  "error": "Error message description"
}

Status Codes

  • 200 OK - Request succeeded
  • 201 Created - Resource created successfully
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Missing or invalid authentication
  • 403 Forbidden - Invalid vendor header or origin
  • 404 Not Found - Resource not found
  • 500 Internal Server Error - Server error

Container States

  • installing - Container is being created and installed
  • ready - Container is ready to start
  • starting - Container is starting up
  • running - Container is running (pattern matched)
  • stopping - Container is stopping
  • failed - Installation or operation failed

Need Help?

Join our Discord

Get support from the community and developers