2025-11-24 19:52:35 +00:00
2025-11-24 19:52:35 +00:00
2025-10-28 13:05:42 +00:00
2025-10-28 13:05:42 +00:00
2025-11-24 19:52:35 +00:00
2025-11-24 19:52:35 +00:00
2025-11-18 19:37:06 +00:00
2025-10-28 13:05:42 +00:00
2025-11-24 19:52:35 +00:00
2025-10-28 13:05:42 +00:00
2025-10-28 13:05:42 +00:00
2025-10-28 13:05:42 +00:00
2025-11-24 19:52:35 +00:00
2025-11-24 19:52:35 +00:00
2025-10-28 13:05:42 +00:00
2025-11-24 19:52:35 +00:00

@serve.zone/onebox

🚀 Self-hosted Docker Swarm platform with native reverse proxy, automatic SSL, and real-time WebSocket updates

Onebox transforms any Linux server into a powerful container hosting platform. Deploy Docker Swarm services with automatic HTTPS, DNS configuration, and a native Deno reverse proxy - all managed through a beautiful Angular web interface with real-time updates.

Issue Reporting and Security

For reporting bugs, issues, or security vulnerabilities, please visit community.foss.global/. This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a code.foss.global/ account to submit Pull Requests directly.

What Makes Onebox Different? 🎯

  • Native Deno Reverse Proxy - Built from scratch in Deno (no Nginx required!), featuring HTTP/HTTPS servers with SNI support and bidirectional WebSocket proxying
  • Docker Swarm First - All workloads run as Swarm services, not standalone containers, for built-in orchestration
  • Real-time Everything - WebSocket-powered live updates for service status, logs, and metrics across all connected clients
  • Single Executable - Compiles to a standalone binary - just run it, no dependencies
  • Private Registry Included - Built-in Docker registry with auto-deploy on push
  • Zero Config SSL - Automatic Let's Encrypt certificates with hot-reload
  • Cloudflare Integration - Automatic DNS record management
  • Modern Stack - Deno runtime + SQLite database + Angular 18 UI

Features

Core Platform

  • 🐳 Docker Swarm Management - Deploy, scale, and orchestrate services with Swarm mode
  • 🌐 Native Reverse Proxy - Deno-based HTTP/HTTPS proxy with dynamic routing from database
  • 🔒 Automatic SSL Certificates - Let's Encrypt integration with hot-reload and renewal monitoring
  • ☁️ Cloudflare DNS Integration - Automatic DNS record creation and synchronization
  • 📦 Built-in Registry - Private Docker registry with per-service tokens and auto-update
  • 🔄 Real-time WebSocket Updates - Live service status, logs, and system events

Monitoring & Management

  • 📊 Metrics Collection - Historical CPU, memory, and network stats (every 60s)
  • 📝 Centralized Logging - Container logs with retention policies
  • 🎨 Angular Web UI - Modern, responsive interface with real-time updates
  • 👥 Multi-user Support - Role-based access control (admin/user)
  • 💾 SQLite Database - Embedded, zero-configuration storage

Developer Experience

  • 🚀 Auto-update on Push - Push to registry and services update automatically
  • 🔐 Private Registry Support - Use Docker Hub, Gitea, or custom registries
  • 🔄 Systemd Integration - Run as a daemon with auto-restart
  • 🎛️ Full CLI & API - Manage everything from terminal or HTTP API

Quick Start 🏁

Installation

# Download the latest release for your platform
curl -sSL https://code.foss.global/serve.zone/onebox/releases/latest/download/onebox-linux-x64 -o onebox
chmod +x onebox
sudo mv onebox /usr/local/bin/

# Or install from npm
pnpm install -g @serve.zone/onebox

First Run

# Start the server in development mode
onebox server --ephemeral

# In another terminal, deploy your first service
onebox service add myapp \
  --image nginx:latest \
  --domain app.example.com \
  --port 80

Access the Web UI

Open http://localhost:3000 in your browser.

Default credentials:

  • Username: admin
  • Password: admin

⚠️ Change the default password immediately after first login!

Production Setup

# Install as systemd service
sudo onebox daemon install

# Start the daemon
sudo onebox daemon start

# View logs
sudo onebox daemon logs

Architecture 🏗️

Onebox is built with modern technologies for performance and developer experience:

┌─────────────────────────────────────────────────┐
│           Angular 18 Web UI                     │
│     (Real-time WebSocket Updates)               │
└─────────────────┬───────────────────────────────┘
                  │ HTTP/WS
┌─────────────────▼───────────────────────────────┐
│         Deno HTTP Server (Port 3000)            │
│    REST API + WebSocket Broadcast               │
└─────────────────┬───────────────────────────────┘
                  │
┌─────────────────▼───────────────────────────────┐
│          Native Reverse Proxy                   │
│   HTTP (80) + HTTPS (443) + SNI + WS Proxy      │
└─────┬───────────────────────────────────────────┘
      │
      ├──► Docker Swarm Services
      ├──► SSL Certificate Manager (Let's Encrypt)
      ├──► Cloudflare DNS Manager
      ├──► Built-in Docker Registry
      └──► SQLite Database

Core Components

  • Deno Runtime - Modern TypeScript with built-in security
  • Native Reverse Proxy - Custom HTTP/HTTPS proxy with TLS SNI support
  • Docker Swarm - Container orchestration (NOT standalone containers)
  • SQLite Database - Configuration, metrics, and user data
  • WebSocket Server - Real-time bidirectional communication
  • Let's Encrypt - Automatic SSL certificate management
  • Cloudflare API - DNS record automation

CLI Reference 📖

Service Management

# Deploy a service
onebox service add <name> --image <image> --domain <domain> [--port <port>] [--env KEY=VALUE]

# Deploy with Onebox Registry (auto-update on push)
onebox service add myapp --use-onebox-registry --domain myapp.example.com

# List services
onebox service list

# Control services
onebox service start <name>
onebox service stop <name>
onebox service restart <name>

# Remove service
onebox service remove <name>

# View logs
onebox service logs <name>

Server Management

# Start server (development)
onebox server --ephemeral          # Runs in foreground with monitoring

# Start server (production)
onebox daemon install              # Install systemd service
onebox daemon start                # Start daemon
onebox daemon stop                 # Stop daemon
onebox daemon logs                 # View logs

Registry Management

# Add external registry credentials
onebox registry add --url registry.example.com --username user --password pass

# List registries
onebox registry list

# Remove registry
onebox registry remove <url>

DNS Management

# Add DNS record (requires Cloudflare config)
onebox dns add <domain>

# List DNS records
onebox dns list

# Sync from Cloudflare
onebox dns sync

# Remove DNS record
onebox dns remove <domain>

SSL Management

# Renew expiring certificates
onebox ssl renew

# Force renew specific domain
onebox ssl force-renew <domain>

# List certificates
onebox ssl list

Configuration

# Show all settings
onebox config show

# Set configuration value
onebox config set <key> <value>

# Example: Configure Cloudflare
onebox config set cloudflareAPIKey your-api-key
onebox config set cloudflareEmail your@email.com
onebox config set cloudflareZoneID your-zone-id

System Status

# Get full system status
onebox status

Configuration 🔧

System Requirements

  • Linux (x64 or ARM64)
  • Docker installed and running
  • Docker Swarm initialized (docker swarm init)
  • Root/sudo access for ports 80/443
  • (Optional) Cloudflare account for DNS automation

Data Locations

  • Database: ./onebox.db (or custom path)
  • SSL Certificates: Managed by CertManager
  • Registry Data: ./.nogit/registry-data

Environment Variables

# Database location
ONEBOX_DB_PATH=/path/to/onebox.db

# HTTP server port (default: 3000)
ONEBOX_HTTP_PORT=3000

# Enable debug logging
ONEBOX_DEBUG=true

Development 💻

Setup

# Clone repository
git clone https://code.foss.global/serve.zone/onebox
cd onebox

# Install dependencies (Deno handles this automatically)
deno task dev

Tasks

# Development server (auto-restart on changes)
deno task dev

# Run tests
deno task test

# Watch mode for tests
deno task test:watch

# Compile binaries for all platforms
deno task compile

Project Structure

onebox/
├── ts/
│   ├── classes/          # Core implementations
│   │   ├── onebox.ts           # Main coordinator
│   │   ├── reverseproxy.ts     # Native HTTP/HTTPS proxy
│   │   ├── docker.ts           # Docker Swarm API
│   │   ├── database.ts         # SQLite storage
│   │   ├── httpserver.ts       # REST API + WebSocket
│   │   ├── services.ts         # Service orchestration
│   │   ├── certmanager.ts      # SSL certificate management
│   │   ├── registry.ts         # Built-in Docker registry
│   │   └── ...
│   ├── cli.ts            # CLI router
│   ├── types.ts          # TypeScript interfaces
│   └── plugins.ts        # Dependency imports
├── ui/                   # Angular web interface
├── test/                 # Test files
├── mod.ts                # Main entry point
└── deno.json             # Deno configuration

API Endpoints

The HTTP server exposes the following endpoints:

  • POST /api/auth/login - User authentication (returns token)
  • GET /api/status - System status (requires auth)
  • GET /api/services - List all services (requires auth)
  • POST /api/services - Create service (requires auth)
  • PUT /api/services/:id - Update service (requires auth)
  • DELETE /api/services/:id - Delete service (requires auth)
  • GET /api/ws - WebSocket connection for real-time updates

See ts/classes/httpserver.ts for complete API documentation.

WebSocket Messages

Real-time updates are broadcast via WebSocket:

// Service lifecycle updates
{
  type: 'service_update',
  action: 'created' | 'updated' | 'deleted' | 'started' | 'stopped',
  service: { id, name, status, ... }
}

// Service status changes
{
  type: 'service_status',
  service: { id, name, status, ... }
}

// System status updates
{
  type: 'system_status',
  status: { docker, reverseProxy, services, ... }
}

Advanced Usage 🚀

Using the Built-in Registry

# Deploy a service with Onebox Registry
onebox service add myapp \
  --use-onebox-registry \
  --domain myapp.example.com \
  --auto-update-on-push

# Get the registry token for pushing images
# (Token is automatically created and stored in database)

# Push your image
docker tag myimage:latest localhost:4000/myapp:latest
docker push localhost:4000/myapp:latest

# Service automatically updates! 🎉

Cloudflare DNS Integration

# Configure Cloudflare (one-time setup)
onebox config set cloudflareAPIKey your-api-key
onebox config set cloudflareEmail your@email.com
onebox config set cloudflareZoneID your-zone-id

# Deploy with automatic DNS
onebox service add myapp \
  --image nginx:latest \
  --domain myapp.example.com

# DNS record is automatically created!

SSL Certificate Management

SSL certificates are automatically obtained and renewed:

  • Certificates are requested when a service with a domain is deployed
  • Renewal happens automatically 30 days before expiry
  • Certificates are hot-reloaded without downtime
  • Force renewal: onebox ssl force-renew <domain>

Monitoring and Metrics

Metrics are collected every 60 seconds (configurable):

# Set metrics interval (milliseconds)
onebox config set metricsInterval 30000

# View in web UI or query database directly
sqlite3 onebox.db "SELECT * FROM metrics WHERE service_id = 1 ORDER BY timestamp DESC LIMIT 10"

Troubleshooting 🔧

Docker Swarm Not Initialized

# Initialize Docker Swarm
docker swarm init

# Verify swarm mode
docker info | grep "Swarm: active"

Port Already in Use

# Check what's using port 80/443
sudo lsof -i :80
sudo lsof -i :443

# Kill the process or change Onebox ports
onebox config set httpPort 8080

SSL Certificate Issues

# Check certificate status
onebox ssl list

# Verify DNS is pointing to your server
dig +short yourdomain.com

# Force certificate renewal
onebox ssl force-renew yourdomain.com

WebSocket Connection Issues

  • Ensure firewall allows WebSocket connections
  • Check browser console for connection errors
  • Verify /api/ws endpoint is accessible

Service Not Starting

# Check Docker logs
docker service logs <service-name>

# Check Onebox logs
onebox daemon logs

# Verify image exists
docker images | grep <image-name>

This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the license file within this repository.

Please note: The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.

Company Information

Task Venture Capital GmbH Registered at District court Bremen HRB 35230 HB, Germany

For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

Description
a single server quick hosting tool
Readme 1 MiB
Languages
TypeScript 94.5%
HTML 3.1%
JavaScript 1.2%
Shell 0.9%
CSS 0.3%