jefriherditriyanto/openclaw-for-9router

By jefriherditriyanto

•Updated 2 days ago

Image
Security
Machine learning & AI
Data science
0

1.0K

jefriherditriyanto/openclaw-for-9router repository overview

⁠OpenClaw for 9Router

Docker Hub Docker Pulls Docker Image Size Platform

A production-ready Docker container that bundles the OpenClaw AI Assistant⁠ with a custom AI provider (9Router), providing a fully automated, secure, and self-contained AI coding environment accessible via Web UI, SSH, and Web Terminal.


⁠✨ Features

FeatureDescription
šŸ¤– OpenClaw AI AssistantPre-installed and auto-onboarded — ready to use instantly
🌐 Web DashboardAccess OpenClaw via browser at port 8080 (No Auth)
šŸ’» Web Terminal (ttyd)Full terminal in the browser at port 6080
šŸ”Œ SSH AccessStandard SSH server on port 22 (mapped to 2222)
🐳 Docker-in-DockerFull Docker daemon running inside the container
šŸ”’ Credential SecurityAPI keys are automatically redacted from all command outputs
šŸ—ļø Multi-ArchitectureSupports both linux/amd64 and linux/arm64
⚔ Auto-InitializationOne-time setup on first boot, instant restart on subsequent runs

ā šŸš€ Quick Start

⁠Using docker run
docker run -d --privileged \
  --cpus="2.0" \
  --memory="2g" \
  -p 2222:22 \
  -p 6080:6080 \
  -p 8080:8080 \
  -v openclaw-data:/home/ubuntu/.openclaw \
  --name openclaw-app \
  --hostname server \
  -e SSH_USER="ubuntu" \
  -e SSH_PASSWORD="ubuntu" \
  -e SAWANG_CLOUD_API_KEY="your-9router-api-key" \
  -e SAWANG_CLOUD_BASE_URL="https://your-9router-provider.com/v1" \
  jefriherditriyanto/openclaw-for-9router:latest
⁠Using docker-compose.yaml
services:
  openclaw:
    image: jefriherditriyanto/openclaw-for-9router:latest
    container_name: openclaw-app
    hostname: server
    privileged: true
    cpus: 2.0
    mem_limit: 2g
    ports:
      - "2222:22"     # SSH
      - "6080:6080"   # Web Terminal (ttyd)
      - "8080:8080"   # OpenClaw Dashboard
    volumes:
      - openclaw-data:/home/ubuntu/.openclaw
    environment:
      - SSH_USER=ubuntu
      - SSH_PASSWORD=ubuntu
      - SAWANG_CLOUD_API_KEY=your-9router-api-key
      - SAWANG_CLOUD_BASE_URL=https://your-9router-provider.com/v1
    restart: unless-stopped

volumes:
  openclaw-data:
docker compose up -d

ā šŸ”— Access Points

Once the container is running, access your environment through:

ServiceURL / CommandCredentials
🌐 OpenClaw Dashboardhttp://localhost:8080None / No Auth
šŸ’» Web Terminalhttp://localhost:6080SSH_USER / SSH_PASSWORD
šŸ”Œ SSHssh -p 2222 <SSH_USER>@localhostSSH_PASSWORD

ā āš™ļø Environment Variables

VariableDefaultDescription
SAWANG_CLOUD_API_KEY(built-in default)Required. API key for the AI model provider
SAWANG_CLOUD_BASE_URL(built-in default)Required. Base URL of the OpenAI-compatible API endpoint
SAWANG_CLOUD_MODELagentModel ID for the AI model provider
SSH_USERubuntuUsername for SSH, Web Terminal, and OpenClaw Dashboard
SSH_PASSWORDubuntuPassword for SSH, Web Terminal, and OpenClaw Dashboard
SSH_HOSTNAMEserverHostname displayed inside the container
SSH_PORT2222SSH port (internal mapping)
TTYD_PORT6080Web Terminal (ttyd) port

ā šŸ—ļø Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│                    Docker Container                       │
│                                                           │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”   ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”   ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │  SSH Daemon  │   │  ttyd Server │   │   OpenClaw    │  │
│  │   :22        │   │   :6080      │   │ Gateway :8080 │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜   ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜   ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
│         │                  │                   │          │
│         ā–¼                  ā–¼                   ā–¼          │
│   ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    │
│   │              User Environment                    │    │
│   │  • Node.js (via NVM)    • Docker-in-Docker       │    │
│   │  • OpenClaw Agent       • git, curl, vim, nano   │    │
│   │  • sudo (SSH-based)     • htop, btop, fastfetch  │    │
│   ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Key internal components:

  • OpenClaw Gateway (:8080) — The web dashboard and API gateway running directly on port 8080.
  • Docker-in-Docker — Full Docker daemon available inside the container for building and running Docker workloads.
  • SSH-based sudo — A custom sudo wrapper that uses localhost SSH key-based elevation, compatible with gVisor and other sandboxed runtimes.

ā šŸ”’ Security

This image implements multiple layers of credential protection:

  1. Runtime Output Censoring — All command execution outputs (printenv, env, cat, etc.) are dynamically intercepted and API keys/URLs are replaced with ***** before being displayed in the OpenClaw UI.

  2. Config File Redaction — The openclaw.json and models.json configuration files have credentials replaced with environment variable placeholders (${SAWANG_CLOUD_API_KEY}, ${SAWANG_CLOUD_BASE_URL}).

  3. Background Credential Watcher — A background process monitors models.json for any credential regeneration and automatically redacts raw values.

  4. Agent Prompt Boundaries — Security instructions are injected into the agent's SOUL.md and BOOTSTRAP.md to prevent the AI from disclosing credentials in its responses.

Note: The --privileged flag is required for Docker-in-Docker functionality. If you don't need DinD, you can omit it, but the internal Docker daemon will not start.


ā šŸ“¦ Pre-installed Software

CategoryPackages
RuntimeNode.js (latest via NVM), npm, npx
AIOpenClaw CLI + Agent
ContainerDocker Engine (Docker-in-Docker)
Editornano, vim
Networkcurl, wget, net-tools, iputils-ping, iproute2, speedtest-cli
Monitoringhtop, btop, fastfetch, neofetch
VCSgit
RemoteOpenSSH Server, ttyd (Web Terminal)

ā šŸ“‹ Exposed Ports

PortProtocolService
22TCPSSH Server
6080TCPWeb Terminal (ttyd)
8080TCPOpenClaw Dashboard

ā šŸ”§ Advanced Usage

⁠Custom AI Provider

This container supports any OpenAI-compatible API endpoint. Simply set your provider's base URL and API key:

-e SAWANG_CLOUD_BASE_URL="https://api.your-provider.com/v1"
-e SAWANG_CLOUD_API_KEY="sk-your-api-key-here"
⁠Persistent Data

To persist the OpenClaw workspace and configuration across container restarts:

-v openclaw-data:/home/ubuntu/.openclaw
⁠Resource Limits

Recommended minimum resources:

--cpus="2.0" --memory="2g"

For heavier workloads or Docker-in-Docker builds:

--cpus="4.0" --memory="4g"

ā šŸ“œ Changelog

⁠0.0.1 — Initial Release
  • OpenClaw AI Assistant with auto-onboarding
  • Web Dashboard with Basic Auth protection
  • Web Terminal (ttyd) access
  • SSH server access
  • Docker-in-Docker support
  • Multi-architecture build (amd64 + arm64)
  • Runtime credential censoring across all output paths
  • Background credential watcher for config files

ā šŸ‘¤ Maintainer

Jefri Herdi Triyanto


ā šŸ“„ License

This project is proprietary software. All rights reserved.

Tag summary

Content type

Image

Digest

sha256:262dee702…

Size

725.4 MB

Last updated

2 days ago

docker pull jefriherditriyanto/openclaw-for-9router