Overview
Discover what makes Tube powerful
Tube is a lightweight, self‑hosted video streaming platform written in **Go** that focuses on simplicity while offering a robust set of developer‑friendly features. At its core, Tube ingests video files via an HTTP upload endpoint or a local file watcher, stores metadata in **Bitcask v2** (a fast key/value store), and serves them through a REST‑style API. The application is built around the Go standard library with minimal external dependencies, making it straightforward to compile for multiple architectures and run inside containers or bare‑metal servers.
Language
Storage
Web Framework
Templating
Overview
Tube is a lightweight, self‑hosted video streaming platform written in Go that focuses on simplicity while offering a robust set of developer‑friendly features. At its core, Tube ingests video files via an HTTP upload endpoint or a local file watcher, stores metadata in Bitcask v2 (a fast key/value store), and serves them through a REST‑style API. The application is built around the Go standard library with minimal external dependencies, making it straightforward to compile for multiple architectures and run inside containers or bare‑metal servers.
Technical Stack & Architecture
- Language: Go 1.20+ – the entire codebase is compiled into a single binary, reducing runtime overhead and easing distribution.
- Storage: Bitcask v2 – an append‑only log‑structured key/value store that offers low latency reads and writes, ideal for video metadata.
- Web Framework: Go’s
net/httpwith the Gorilla Mux router for clean routing and middleware support. - Templating: Go’s
html/templatefor server‑side rendering of the UI, with static assets served from a bundled/staticdirectory. - Containerization: Official Dockerfiles support multi‑arch builds (amd64, arm64) and are published on Docker Hub. The container exposes ports 80/443 for HTTP/HTTPS and mounts a persistent volume for uploads.
The architecture follows a classic MVC pattern: the controller layer (handlers) parses requests, the model layer interacts with Bitcask for CRUD operations, and the view layer renders HTML or JSON. Video files themselves are stored on the filesystem under a configurable uploads directory, while transcoding is currently in progress but will be handled asynchronously via a worker queue.
Core Capabilities & APIs
- Upload API:
POST /api/uploadaccepts multipart/form‑data and returns a JSON payload containing the video ID, title, and URLs. - Metadata API: CRUD endpoints (
GET /api/videos/{id},PUT /api/videos/{id},DELETE /api/videos/{id}) allow full control over video attributes such as title, description, and tags. - Streaming: Range requests are fully supported; the server streams video chunks directly from disk, enabling adaptive bitrate playback with standard HTML5
<video>elements. - Search & Filtering: Query parameters (
?tag=...&title=...) provide simple full‑text search over titles and tags. - Webhooks: Developers can register callbacks that are invoked on upload or deletion events, enabling integration with CI/CD pipelines or external notification services.
All endpoints are documented via Swagger‑style comments in the source, and the API is intentionally RESTful to ease consumption by any language or framework.
Deployment & Infrastructure
Tube can run on any platform that supports Go binaries: Linux, macOS, Windows, and even embedded devices. For production, a Docker Compose setup is recommended:
- Persist the
uploadsdirectory and Bitcask data volume to avoid data loss on container restarts. - Use a reverse proxy (NGINX or Caddy) to handle TLS termination and HTTP/2 acceleration.
- Scale horizontally by running multiple Tube instances behind a load balancer; Bitcask’s single‑writer lock means only one instance should write to the same database file, so a shared filesystem or a distributed key/value store (e.g., etcd) would be required for true multi‑node writes.
The application is lightweight (under 30 MB), making it suitable for edge deployments or low‑resource environments such as Raspberry Pi clusters.
Integration & Extensibility
While Tube’s core is intentionally minimal, its plugin architecture allows developers to extend functionality:
- Custom Importers: The
importerspackage can be forked to add support for external video sources (e.g., YouTube, Vimeo) by implementing a simple interface. - Middleware Hooks: Gorilla Mux middleware can be injected to add authentication, rate limiting, or custom logging.
- Webhooks & Callbacks: External services can subscribe to upload events, enabling automated transcoding pipelines or content moderation checks.
The codebase follows a clean module layout (cmd, app, utils, videos), making it straightforward to add new features without touching unrelated components.
Developer Experience
The project’s documentation is concise but comprehensive: a single README.md explains usage, while inline comments provide context for each package. The issue tracker and pull request workflow are active, with contributors regularly adding multi‑arch binaries and Docker images. Community support is primarily via GitHub Discussions, where developers can ask questions or propose extensions.
Use Cases
- Private Video Hosting: Organizations needing an internal video library without relying on cloud services.
- Learning Platforms: E‑learning providers that require a lightweight, self‑hosted video server with custom metadata.
- Edge Streaming: Deploy on local servers or IoT devices to provide low‑latency video playback for distributed teams.
- Content Moderation Pipelines: Hook into upload events to trigger automated moderation or transcoding workflows.
Advantages
- Zero External Dependencies: A single binary, no database servers or message queues required.
- Fast Startup & Low Footprint: Ideal for containerized environments and rapid scaling.
- Open‑Source Licensing (MIT): Full freedom to modify, distribute, or embed Tube in commercial products.
- Active Maintenance: Recent commits
Open SourceReady to get started?
Join the community and start self-hosting Tube today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
InspIRCd
Modular, lightweight IRC server for modern OSes
LedgerSMB
Open-source ERP for small‑to‑medium businesses
Wastebin
A minimal, fast paste‑sharing service with encryption and QR codes
Reactive Resume
Build and share resumes in seconds, privately
Chevereto
Self‑hosted image and video sharing platform

Jami
Peer‑to‑peer encrypted communication for all devices
