@serve.zone/onebox

a single server quick hosting tool

readme.md for @serve.zone/onebox

🚀 Self-hosted Docker Swarm platform with Caddy 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 Caddy reverse proxy running as a Docker service - 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? 🎯

Features ✨

Core Platform

Monitoring & Management

Developer Experience

Quick Start 🏁

Installation

# One-line install (recommended)
curl -sSL https://code.foss.global/serve.zone/onebox/raw/branch/main/install.sh | sudo bash

# Install a specific version
curl -sSL https://code.foss.global/serve.zone/onebox/raw/branch/main/install.sh | sudo bash -s -- --version v1.11.0

# 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:

⚠️ 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 19 Web UI                     │
│     (Real-time WebSocket Updates)               │
└─────────────────┬───────────────────────────────┘
                  │ HTTP/WS
┌─────────────────▼───────────────────────────────┐
│         Deno HTTP Server (Port 3000)            │
│    REST API + WebSocket Broadcast               │
└─────────────────┬───────────────────────────────┘
                  │
┌─────────────────▼───────────────────────────────┐
│              Docker Swarm                       │
│        ┌──────────────────────────────┐         │
│        │   onebox-network (overlay)   │         │
│        ├──────────────────────────────┤         │
│        │  onebox-caddy (Caddy proxy)  │         │
│        │  HTTP (80) + HTTPS (443)     │         │
│        │  Admin API → config updates  │         │
│        ├──────────────────────────────┤         │
│        │  Your Services               │         │
│        │  (reachable by service name) │         │
│        └──────────────────────────────┘         │
└─────┬───────────────────────────────────────────┘
      │
      ├──► SSL Certificate Manager (Let's Encrypt)
      ├──► Cloudflare DNS Manager
      ├──► Built-in Docker Registry
      └──► SQLite Database

Core Components

Component Description
Deno Runtime Modern TypeScript with built-in security
Caddy Reverse Proxy Docker Swarm service with HTTP/2, HTTP/3, SNI, and WebSocket support
Docker Swarm Container orchestration (all workloads run as services)
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

Upgrade

# Upgrade to the latest version (requires root)
sudo onebox upgrade

Configuration 🔧

System Requirements

Data Locations

Data Location
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

# Start development server (auto-restart on changes)
pnpm run watch

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         # Reverse proxy orchestration
│   │   ├── caddy.ts                # Caddy Docker service management
│   │   ├── docker.ts               # Docker Swarm API
│   │   ├── httpserver.ts           # REST API + WebSocket
│   │   ├── services.ts             # Service orchestration
│   │   ├── certmanager.ts          # SSL certificate management
│   │   ├── cert-requirement-manager.ts  # Certificate requirements
│   │   ├── ssl.ts                  # SSL utilities
│   │   ├── registry.ts             # Built-in Docker registry
│   │   ├── registries.ts           # External registry management
│   │   ├── dns.ts                  # DNS record management
│   │   ├── cloudflare-sync.ts      # Cloudflare zone sync
│   │   ├── daemon.ts               # Systemd daemon management
│   │   └── apiclient.ts            # API client utilities
│   ├── database/                   # Database layer (repository pattern)
│   │   ├── index.ts                # Main OneboxDatabase class
│   │   ├── base.repository.ts      # Base repository class
│   │   └── repositories/           # Domain-specific repositories
│   │       ├── service.repository.ts
│   │       ├── certificate.repository.ts
│   │       ├── auth.repository.ts
│   │       ├── metrics.repository.ts
│   │       └── ...
│   ├── cli.ts                      # CLI router
│   ├── types.ts                    # TypeScript interfaces
│   ├── logging.ts                  # Logging utilities
│   └── plugins.ts                  # Dependency imports
├── ui/                             # Angular 19 web interface
├── test/                           # Test files
├── mod.ts                          # Main entry point
└── deno.json                       # Deno configuration

API Endpoints

The HTTP server exposes a comprehensive REST API:

Authentication

Method Endpoint Description
POST /api/auth/login User authentication (returns token)

Services

Method Endpoint Description
GET /api/services List all services
POST /api/services Create/deploy service
GET /api/services/:name Get service details
PUT /api/services/:name Update service
DELETE /api/services/:name Delete service
POST /api/services/:name/start Start service
POST /api/services/:name/stop Stop service
POST /api/services/:name/restart Restart service
GET /api/services/:name/logs Get service logs
WS /api/services/:name/logs/stream Stream logs via WebSocket

SSL Certificates

Method Endpoint Description
GET /api/ssl/list List all certificates
GET /api/ssl/:domain Get certificate details
POST /api/ssl/obtain Request new certificate
POST /api/ssl/:domain/renew Force renew certificate

Domains

Method Endpoint Description
GET /api/domains List all domains
GET /api/domains/:domain Get domain details
POST /api/domains/sync Sync domains from Cloudflare

DNS Records

Method Endpoint Description
GET /api/dns List DNS records
POST /api/dns Create DNS record
DELETE /api/dns/:domain Delete DNS record
POST /api/dns/sync Sync DNS from Cloudflare

Registry

Method Endpoint Description
GET /api/registry/tags/:service Get registry tags for service
GET /api/registry/tokens List registry tokens
POST /api/registry/tokens Create registry token
DELETE /api/registry/tokens/:id Delete registry token

System

Method Endpoint Description
GET /api/status System status
GET /api/settings Get settings
PUT /api/settings Update settings
WS /api/ws WebSocket for real-time updates

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! 🎉

Registry Token Management

# Create a CI/CD token via API
curl -X POST http://localhost:3000/api/registry/tokens \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "github-actions", "type": "ci", "scope": ["myapp"], "expiresIn": "90d"}'

# Use token for docker login
docker login localhost:4000 -u ci -p <token>

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!

# Sync all domains from Cloudflare
onebox dns sync

SSL Certificate Management

SSL certificates are automatically obtained and renewed:

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

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.

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.

Company Information

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

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.

changelog.md for @serve.zone/onebox

2026-03-24 - 1.24.2 - fix(deps)

bump runtime and build tool dependencies

2026-03-24 - 1.24.1 - fix(repo)

migrate smart build config to .smartconfig.json and tidy repository metadata

2026-03-24 - 1.24.0 - feat(backup)

add containerarchive-backed backup storage, restore, download, and pruning support

2026-03-21 - 1.23.0 - feat(appstore)

add remote app store templates with service upgrades and Redis/MariaDB platform support

2026-03-18 - 1.22.2 - fix(web-ui)

stabilize app store service creation flow and add Ghost sqlite defaults

2026-03-18 - 1.22.1 - fix(repo)

no changes to commit

2026-03-18 - 1.22.0 - feat(web-appstore)

add an App Store view for quick service deployment from curated templates

2026-03-18 - 1.21.0 - feat(opsserver)

add container workspace API and backend execution environment for services

2026-03-17 - 1.20.0 - feat(ops-dashboard)

stream user service logs to the ops dashboard and resolve service containers for Docker log streaming

2026-03-17 - 1.19.12 - fix(repo)

no changes to commit

2026-03-17 - 1.19.11 - fix(repo)

no changes to commit

2026-03-17 - 1.19.10 - fix(repo)

no changes to commit

2026-03-17 - 1.19.9 - fix(repo)

no changes to commit

2026-03-17 - 1.19.8 - fix(repo)

no changes to commit

2026-03-17 - 1.19.7 - fix(repo)

no changes to commit

2026-03-17 - 1.19.6 - fix(repository)

no changes to commit

2026-03-17 - 1.19.5 - fix(repo)

no changes to commit

2026-03-17 - 1.19.4 - fix(repository)

no changes to commit

2026-03-16 - 1.19.3 - fix(repo)

no changes to commit

2026-03-16 - 1.19.2 - fix(docs)

remove outdated UI screenshot assets from project documentation

2026-03-16 - 1.19.1 - fix(dashboard)

add updated dashboard screenshots for refresh and resource usage states

2026-03-16 - 1.19.1 - fix(dashboard)

add aggregated resource usage stats to the dashboard

2026-03-16 - 1.19.0 - feat(opsserver,web)

add real-time platform service log streaming to the dashboard

2026-03-16 - 1.18.5 - fix(platform-services)

fix platform service detail view navigation and log display

2026-03-16 - 1.18.4 - fix(repo)

no changes to commit

2026-03-16 - 1.18.3 - fix(deps)

bump @serve.zone/catalog to ^2.6.1

2026-03-16 - 1.18.2 - fix(repo)

no changes to commit

2026-03-16 - 1.18.1 - fix(repo)

no changes to commit

2026-03-16 - 1.18.0 - feat(platform-services)

add platform service log retrieval and display in the services UI

2026-03-16 - 1.17.4 - fix(docs)

add hello world running screenshot for documentation

2026-03-16 - 1.17.3 - fix(mongodb)

downgrade the MongoDB service image to 4.4 and use the legacy mongo shell for container operations

2026-03-16 - 1.17.2 - fix(platform-services)

provision ClickHouse, MinIO, and MongoDB resources via docker exec instead of host port access

2026-03-16 - 1.17.1 - fix(repo)

no changes to commit

2026-03-16 - 1.17.0 - feat(web/services)

add deploy service action to the services view

2026-03-16 - 1.16.0 - feat(services)

add platform service navigation and stats in the services UI

2026-03-16 - 1.15.3 - fix(install)

refresh systemd service configuration before restarting previously running installations

2026-03-16 - 1.15.2 - fix(systemd)

set HOME and DENO_DIR for the systemd service environment

2026-03-16 - 1.15.1 - fix(systemd)

move Docker installation and swarm initialization to systemd enable flow

2026-03-16 - 1.15.0 - feat(systemd)

replace smartdaemon-based service management with native systemd commands

2026-03-16 - 1.14.10 - fix(services)

stop auto-update monitoring during shutdown

2026-03-16 - 1.14.9 - fix(repo)

no changes to commit

2026-03-16 - 1.14.8 - fix(repo)

no changes to commit

2026-03-16 - 1.14.7 - fix(repo)

no changes to commit

2026-03-16 - 1.14.6 - fix(project)

no changes to commit

2026-03-16 - 1.14.5 - fix(onebox)

move Docker auto-install and swarm initialization into Onebox startup flow

2026-03-16 - 1.14.4 - fix(repo)

no changes to commit

2026-03-16 - 1.14.3 - fix(repo)

no changes to commit

2026-03-16 - 1.14.2 - fix(repo)

no changes to commit

2026-03-16 - 1.14.1 - fix(repo)

no changes to commit

2026-03-16 - 1.14.0 - feat(daemon)

auto-install Docker and initialize Swarm during daemon service setup

2026-03-16 - 1.13.17 - fix(ci)

remove forced container image pulling from Gitea workflow jobs

2026-03-16 - 1.13.16 - fix(ci)

refresh workflow container images on every run and bump @apiclient.xyz/docker to ^5.1.1

2026-03-15 - 1.13.15 - fix(repo)

no changes to commit

2026-03-15 - 1.13.14 - fix(repo)

no changes to commit

2026-03-15 - 1.13.13 - fix(repo)

no changes to commit

2026-03-15 - 1.13.12 - fix(ci)

run pnpm install with --ignore-scripts in CI and release workflows

2026-03-15 - 1.13.11 - fix(project)

no changes to commit

2026-03-15 - 1.13.10 - fix(deps)

bump @git.zone/tsdeno to ^1.2.0

2026-03-15 - 1.13.9 - fix(repo)

no changes to commit

2026-03-15 - 1.13.8 - fix(repo)

no changes to commit

2026-03-15 - 1.13.7 - fix(repo)

no changes to commit

2026-03-15 - 1.13.6 - fix(ci)

correct workflow container image registry path

2026-03-15 - 1.13.5 - fix(workflows)

switch Gitea workflow containers from ht-docker-dbase to ht-docker-node

2026-03-15 - 1.13.4 - fix(ci)

run workflows in the shared build container and enable corepack for pnpm installs

2026-03-15 - 1.13.3 - fix(build)

replace custom Deno compile scripts with tsdeno-based binary builds in CI and release workflows

2026-03-15 - 1.13.2 - fix(scripts)

install production dependencies before compiling binaries and exclude local node_modules from builds

2026-03-15 - 1.13.1 - fix(deno)

remove nodeModulesDir from Deno configuration

2026-03-15 - 1.13.0 - feat(install)

improve installer with version selection, service restart handling, and upgrade documentation

2026-03-15 - 1.12.1 - fix(package.json)

update package metadata

2026-03-15 - 1.12.0 - feat(cli,release)

add self-upgrade command and automate CI, release, and npm publishing workflows

2026-03-03 - 1.11.0 - feat(services)

map backend service data to UI components, add stats & logs parsing, fetch service stats, and fix logs request param

2026-03-02 - 1.10.3 - fix(bin)

make bin/onebox-wrapper.js executable

2026-03-02 - 1.10.2 - fix(build)

update build/watch configuration, switch to esbuild bundler and tswatch, and bump catalog and tooling dependencies

2026-02-24 - 1.10.1 - fix(package.json)

update package metadata

2026-02-24 - 1.10.0 - feat(opsserver)

introduce OpsServer (TypedRequest API) and new lightweight web UI; replace legacy Angular UI and add typed interfaces

2025-12-03 - 1.9.2 - fix(ui)

Add VS Code configs for the UI workspace and normalize dark theme CSS variables

2025-11-27 - 1.9.1 - fix(ui)

Correct import success toast and add VS Code launch/tasks recommendations for the UI

2025-11-27 - 1.9.0 - feat(backups)

Add backup import API and improve backup download/import flow in UI

2025-11-27 - 1.8.0 - feat(backup)

Add backup scheduling system with GFS retention, API and UI integration

2025-11-27 - 1.7.0 - feat(backup)

Add backup system: BackupManager, DB schema, API endpoints and UI support

Introduce a complete service backup/restore subsystem with encrypted archives, database records and REST endpoints. Implements BackupManager with export/import for service config, platform resources (MongoDB, MinIO, ClickHouse), and Docker images; adds BackupRepository and migrations for backups table and include_image_in_backup; integrates backup flows into the HTTP API and the UI client; exposes backup password management and restore modes (restore/import/clone). Wire BackupManager into Onebox initialization.

2025-11-27 - 1.6.0 - feat(ui.dashboard)

Add Resource Usage card to dashboard and make dashboard cards full-height; add VSCode launch/tasks/config

2025-11-27 - 1.5.0 - feat(network)

Add traffic stats endpoint and dashboard UI; enhance platform services and certificate health reporting

2025-11-26 - 1.4.0 - feat(platform-services)

Add ClickHouse platform service support and improve related healthchecks and tooling

2025-11-26 - 1.3.0 - feat(platform-services)

Add ClickHouse platform service support (provider, types, provisioning, UI and port mappings)

2025-11-26 - 1.2.1 - fix(platform-services/minio)

Improve MinIO provider: reuse existing data and credentials, use host-bound port for provisioning, and safer provisioning/deprovisioning

2025-11-26 - 1.2.0 - feat(ui)

Sync UI tab state with URL and update routes/links

2025-11-26 - 1.1.0 - feat(platform-services)

Add platform service log streaming, improve health checks and provisioning robustness

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Added

[1.0.0] - TBD

Added