Awesome Go

docklite

CategorySoftware Packages
SubcategoryDevOps Tools
Stars0

Lightweight Portainer alternative for Docker container management with real-time SSE metrics

About docklite

⚔ Docklite

Go Reference Go Report Card Coverage Awesome Go Release Status: Pre-Release License: GPL-3.0 Platform

🌐 Official Website: https://docklite.benzjeremy.pp.ua/ šŸ“– Official Wiki & Documentation: https://docklite.benzjeremy.pp.ua/wiki/

[!IMPORTANT]

🚧 Pre-Release / Active Development Notice

This software is not yet finished and is under active development.
All releases and binaries are Pre-Releases (Work in Progress), even if originally tagged or announced without a pre-release flag. Features, UI components, and API behaviors are subject to continuous refinement.

The radically lightweight, lightning-fast Portainer alternative written in Go & Astro.
A single native binary for Linux and Windows, direct communication with the Docker socket (docker.sock), approx. 10–15 MB RAM usage, and zero framework overhead.


šŸŽÆ The Problem with Portainer & Why Docklite?

Portainer is excessively bloated for simple server and homelab setups:

  • āŒ Resource Heavy: Consumes 150 to 300+ MB RAM for a simple daemon.
  • āŒ Cumbersome: Dedicated database, complex user management, sluggish web interface.
  • āŒ Unnecessary Overhead: When all you want is to inspect CPU/RAM stats, view logs, or restart a container.

Docklite solves exactly this:

  • ⚔ Minimal Footprint: Only approx. 10–15 MB RAM during active operation.
  • ⚔ Single Standalone Binary: The complete Astro web interface is compiled into the Go binary via go:embed. No external Node.js or web server dependencies!
  • ⚔ In-Browser Container Exec: Interactive terminal via WebSockets directly into any running container (/bin/sh, /bin/bash) with PTY window resize synchronization.
  • ⚔ Docker Compose Stack Inspector: Automatic detection and grouping of Compose projects (com.docker.compose.project) with 1-click stack restart and stop.
  • ⚔ Volume & Network Management: Clean up dangling volumes and networks (POST /api/v1/volumes/prune, /networks/prune).
  • ⚔ Direct Docker Socket: Communicates natively over HTTP-over-Unix-Socket (/var/run/docker.sock) on Linux or Named Pipe (//./pipe/docker_engine) on Windows.
  • ⚔ Real-Time Monitoring: Live CPU %, memory (with cgroup v1/v2 cache cleanup), network Rx/Tx, and block I/O via Server-Sent Events (SSE).
  • ⚔ Full Control: Start, stop, restart, pause, remove, live logs, and interactive inspection with a single click.
  • ⚔ REST API: Developer-friendly endpoints for custom automation scripts and monitoring tools.
  • šŸ›”ļø Security by Design: Host header validation (Anti-DNS-Rebinding), Anti-CSRF, Anti-CSWSH, strict CSP & security headers, optional authentication token (--token).

šŸš€ Quick Start

1. Download Precompiled Binaries (Linux / Windows)

Download the matching binary directly from the Releases page (Latest):

  • Linux (AMD64): Download docklite-*-linux-amd64.tar.gz, extract, and execute ./docklite.
  • Windows (AMD64): Download docklite-*-windows-amd64.zip, extract, and run docklite.exe.

2. Installation via Go (Always Latest)

go install github.com/benzjeremy/docklite@latest
docklite --port 8080

Then open http://localhost:8080 in your web browser!


āš™ļø CLI Options

Usage of docklite:
  -docker-host string
        Docker socket path or URI (default: unix:///var/run/docker.sock or npipe:////./pipe/docker_engine)
  -host string
        Host address to bind to (default: "127.0.0.1")
  -open
        Automatically open the default browser upon launch
  -port int
        HTTP port for dashboard and REST API (default: 8080)
  -token string
        Optional security token for API authentication (X-Docklite-Token)
  -version
        Show version and exit

Example with custom port 9090 and a secure token:

docklite --port 9090 --token "secret-token-123"

šŸ“” REST API Specification

Docklite provides a direct REST API for quick integration into dashboards and shell scripts:

MethodPathDescription
GET/api/v1/pingHealth check & Docker socket reachability
GET/api/v1/versionDocklite and Docker Engine versions
GET/api/v1/systemHost information, CPU cores, memory limits
GET/api/v1/containersContainer list (?all=true, ?stats=true)
GET/api/v1/containers/{id}Detailed container inspect (JSON)
GET/api/v1/containers/{id}/statsLive CPU%, Memory MB/Limit, Net & Block I/O
GET/api/v1/containers/{id}/logsDemuxed logs (?tail=150, ?timestamps=true)
POST/api/v1/containers/{id}/startStart container
POST/api/v1/containers/{id}/stopStop container (10s timeout)
POST/api/v1/containers/{id}/restartRestart container
POST/api/v1/containers/{id}/pausePause container
POST/api/v1/containers/{id}/unpauseResume paused container
GET/api/v1/imagesLocal Docker images and disk usage
GET/api/v1/liveServer-Sent Events (SSE) stream of all containers every 2s

šŸ“¦ Build from Source

Prerequisites

  • Go >= 1.22
  • Node.js >= 20 & npm
# 1. Clone repository
git clone https://github.com/benzjeremy/docklite.git
cd docklite

# 2. Build Astro Frontend
cd frontend
npm install
npm run build
cd ..

# 3. Compile Go Standalone Binary
go build -o docklite main.go

šŸ“š Wiki & Documentation

Detailed documentation, benchmarks, and API specifications are available in our official web wiki:
šŸ‘‰ Docklite Wiki: https://docklite.benzjeremy.pp.ua/wiki/


šŸ›”ļø License & Author

Frequently Asked Questions

What is docklite?

docklite is a Software Packages library for the Go programming language. Lightweight Portainer alternative for Docker container management with real-time SSE metrics

How do I install docklite?

Install docklite with the Go module system using `go get benzjeremy/docklite`. Check the repository for the current installation instructions.

What category does docklite belong to?

docklite is listed under Software Packages, specifically DevOps Tools.

← Back to DevOps Tools