Orchestration and master template for Ubuntu-based development environments. This project provides a standardized, reproducible, and portable environment with automated hardware architecture detection, intelligent resource reporting, and optional zero-trust remote access.
- Linux: Native support with optional LXCFS integration.
- macOS: Supported via Docker Desktop.
- Windows: Supported via WSL2.
- Hardware: x86_64 or aarch64 (ARM64) architecture.
- Software: Docker Engine 20.10+ and Docker Compose v2.0+.
git clone https://github.com/1999AZZAR/ghost-machines.git
cd ghost-machinesOn Linux hosts, install LXCFS for accurate resource reporting:
chmod +x setup-host.sh
./setup-host.shThe start.sh script provides interactive selection for the Engine (Ubuntu or Debian) and the Deployment Mode:
chmod +x start.sh
./start.shEngines:
- Ubuntu: Standard, feature-rich base.
- Debian: Slim, lightweight, and high-stability base.
- Alpine: Ultra-lightweight, minimal security-focused base.
The project supports .env files for managing environment variables. Copy the example template to get started:
cp .env.example .env
# Edit .env to add your TUNNEL_TOKEN or customize portsTo enable secure remote access via Cloudflare Tunnel without opening host ports, export your tunnel token before starting:
export TUNNEL_TOKEN="your_cloudflare_tunnel_token"
./start.shArchive and recover your workspace state across physical machines:
- Snapshot:
./snapshot.sh(Creates a.tar.gzof themounts/directory) - Restore:
./restore.sh <snapshot_file.tar.gz>
Use the clean.sh utility to stop and prune environments:
chmod +x clean.sh
./clean.shThis project implements a Semi-Immutable Architecture, following the "Cattle, Not Pets" philosophy for development environments.
The entire toolchain, OS configuration, and runtime environment are defined as a read-only Docker image. This ensures environmental consistency across different physical hosts and prevents "configuration drift" over time.
User data and project code are isolated in persistent volume mounts. By separating the Environment (Immutable) from the Data (Mutable), the ghost machines become entirely disposable.
- Predictability: Eliminates the "it works on my machine" problem by standardizing the build process.
- Resilience: If an environment becomes unstable, it can be destroyed and redeployed in seconds without data loss.
- Security: Every restart reverts the system writable layer to a verified, known-good state defined in the codebase.
The Ghost Machine framework utilizes a layered, copy-on-write (CoW) filesystem architecture to minimize resource consumption during scaling.
| Engine | Base Image | Compressed Size | Characteristics |
|---|---|---|---|
| Ubuntu | ubuntu:latest |
~4.69 GB | Feature-rich, broad PPA support, standard dev experience. |
| Debian | debian:stable-slim |
~4.68 GB | Lightweight, high stability, minimal background overhead. |
| Alpine | alpine:latest |
~3.04 GB | Ultra-lightweight, minimal security-focused base. |
- Marginal Disk Cost: < 1 MB per additional instance. Since all instances share the read-only base layers of their respective engine, new machines only consume space for unique writable data.
- Memory Scaling: While disk space is shared, RAM is allocated per instance. Each machine is restricted to the defined memory limits (default: 8 GB) but only consumes what is actively required by running processes.
| Mode | Instances | CPU Limit | RAM Limit | Use Case |
|---|---|---|---|---|
| Dual | 2 | 1.0 (each) | 8G (each) | Standard distributed development. |
| Single | 1 | 1.0 | 8G | Minimal resource footprint. |
| Power | 1 | 2.0 | 16G | High-performance computing tasks. |
| Half-Host | 1 | 50% Host | 50% Host | Dynamic scaling based on host power. |
Containers are named dynamically based on the active mode:
- Dual:
ghost-machine1,ghost-machine2 - Single/Power/Half:
ghost-machine-single,ghost-machine-power,ghost-machine-half
- Runtimes: Node.js, Go 1.24, Python 3, Bun.
- Editors: Micro, Helix, Lazygit.
- Utilities: nnn (File Manager), fzf (Fuzzy Finder), ripgrep (Search), tmux (Multiplexer).
- Modern CLI: bat (cat with syntax), eza (better ls), zoxide (smarter cd), fd (faster find), jq (json processor), kitty (terminfo & utils).
- AI Integrations: Gemini CLI, OpenAI Codex, RTK (Rust Token Killer).
- MCP Servers: Terminal, Filesystem, and Sequential Thinking (pre-installed in
/root/MCPservers). - Monitoring: btop, htop, nmap, fastfetch, oh-my-bash, alias-hub.
- Default Username: root
- Default Password: root
The default configuration allows root login over SSH. For non-sandbox environments:
- Modify the
rootpassword in theDockerfile. - Update
sshd_configto disable password authentication.
Add helper aliases to your shell configuration:
cat aliases.sh >> ~/.bashrc
source ~/.bashrcCommands:
start-ghost: Enters the active instance (any mode).start-ghost1: Entersghost-machine1(available indualmode).start-ghost2: Entersghost-machine2(available indualmode).