A powerful remote dashboard for managing OpenCode AI instances on your servers. Monitor system resources, manage files, access terminals, and control OpenCode - all from a beautiful web interface.
┌─────────────────────┐ ┌─────────────────────────────────┐
│ Your Computer │ │ Your Server │
│ │ │ │
│ ┌───────────────┐ │ Internet │ ┌───────────┐ ┌───────────┐ │
│ │ Dashboard │──┼───────────────────▶│ │ Agent │───▶│ OpenCode │ │
│ │ (Browser) │ │ │ │ :4097 │ │ :4096 │ │
│ └───────────────┘ │ │ └───────────┘ └───────────┘ │
└─────────────────────┘ └─────────────────────────────────┘
- Features
- Quick Start
- Installation
- Configuration
- Architecture
- API Reference
- Security
- Development
- Troubleshooting
- Contributing
- License
| Feature | Description |
|---|---|
| File Browser | Browse, create, edit, rename, and delete files on your remote server with syntax highlighting |
| System Monitor | Real-time monitoring of CPU, RAM, disk usage, and system load with live charts |
| OpenCode Management | Install, start, stop, and restart OpenCode AI with one click |
| Web Terminal | Full-featured terminal access directly in your browser via WebSocket |
| Session History | View and search through OpenCode conversation history |
| Isolated Workspaces | Run code in secure systemd-nspawn containers for sandboxed execution |
| Multi-User Auth | Secure authentication with bcrypt password hashing and JWT tokens |
| Responsive Design | Works seamlessly on desktop, tablet, and mobile devices |
Get up and running in under 5 minutes.
ssh user@your-server
curl -fsSL https://raw.githubusercontent.com/itsmylife44/opencode-dashboard/main/scripts/install-agent.sh | bashThe installer will:
- Download the appropriate binary for your architecture
- Create a dedicated
opencodeuser (if running as root) - Set up a systemd service
- Install workspace dependencies (systemd-nspawn, debootstrap)
- Generate a secure authentication token
After installation, you'll see:
════════════════════════════════════════════════════════
OpenCode Agent installed successfully!
════════════════════════════════════════════════════════
Dashboard Connection Details:
Agent URL: http://203.0.113.50:4097
Auth Token: a7f3b2c1d4e5f6a7b8c9d0e1f2a3b4c5...
Workspace Support:
✓ systemd-nspawn installed
✓ debootstrap installed
✓ Workspace directory: /home/opencode/.opencode-workspaces
Save these credentials - you'll need them in the dashboard!
════════════════════════════════════════════════════════
Save the Auth Token - you'll need it to connect the dashboard.
On your local machine:
git clone https://github.com/itsmylife44/opencode-dashboard.git
cd opencode-dashboard
bun install
bun run dev- Open http://localhost:3000 in your browser
- Select "Agent" mode in the setup wizard
- Enter your server's Agent URL and Auth Token
- Create your dashboard login credentials
- Start managing your server!
The install script supports running as root or as a regular user:
curl -fsSL https://raw.githubusercontent.com/itsmylife44/opencode-dashboard/main/scripts/install-agent.sh | bashWhen running as root, you'll be prompted to:
- Create a new
opencodeuser (recommended) - Use an existing user
- Run as root (not recommended)
Supported Operating Systems:
| OS | Architectures | Package Manager |
|---|---|---|
| Ubuntu 20.04+ | amd64, arm64 | apt |
| Debian 11+ | amd64, arm64 | apt |
| Fedora 36+ | amd64, arm64 | dnf |
| CentOS/RHEL 8+ | amd64, arm64 | yum |
| Arch Linux | amd64, arm64 | pacman |
| Alpine Linux | amd64, arm64 | apk |
Environment Variables:
| Variable | Default | Description |
|---|---|---|
AGENT_PORT |
4097 |
Port the agent listens on |
AGENT_TOKEN |
auto-generated | Authentication token |
AGENT_USER |
interactive | User to run the agent as |
INSTALL_DIR |
~/.local/bin |
Binary installation directory |
SKIP_SYSTEMD |
false |
Skip systemd service setup |
SKIP_WORKSPACES |
false |
Skip workspace dependency installation |
Example with custom settings:
AGENT_PORT=8080 SKIP_WORKSPACES=true curl -fsSL https://raw.githubusercontent.com/itsmylife44/opencode-dashboard/main/scripts/install-agent.sh | bashDownload the binary directly:
# AMD64 (Intel/AMD processors)
curl -fsSL https://github.com/itsmylife44/opencode-dashboard/releases/latest/download/opencode-agent-linux-amd64 -o opencode-agent
# ARM64 (Raspberry Pi, Apple Silicon VMs, AWS Graviton)
curl -fsSL https://github.com/itsmylife44/opencode-dashboard/releases/latest/download/opencode-agent-linux-arm64 -o opencode-agent
chmod +x opencode-agentVerify the download:
curl -fsSL https://github.com/itsmylife44/opencode-dashboard/releases/latest/download/opencode-agent-linux-amd64.sha256 | sha256sum -cRun the agent:
export AGENT_TOKEN=$(openssl rand -hex 32)
echo "Your token: $AGENT_TOKEN"
./opencode-agentPrerequisites:
- Node.js 20+ or Bun (recommended)
- Modern web browser (Chrome, Firefox, Safari, Edge)
Installation:
git clone https://github.com/itsmylife44/opencode-dashboard.git
cd opencode-dashboard
# Using Bun (recommended)
bun install
bun run dev
# Or using npm
npm install
npm run devThe dashboard will be available at http://localhost:3000.
Production Build:
bun run build
bun run startDashboard settings are stored in ~/.opencode-dashboard/:
| File | Purpose |
|---|---|
credentials.json |
Encrypted user credentials (bcrypt) |
settings.json |
Connection settings and preferences |
.setup.lock |
Setup completion flag |
The agent is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
AGENT_PORT |
4097 |
HTTP server port |
AGENT_TOKEN |
required | Authentication token (64-char hex) |
AGENT_HOME_ONLY |
true |
Restrict file access to user's home directory |
WORKSPACE_PATH |
~/.opencode-workspaces |
Directory for isolated workspaces |
OPENCODE_SERVER_URL |
http://localhost:4096 |
OpenCode API endpoint |
Ensure port 4097 (or your custom port) is accessible:
# Ubuntu/Debian (UFW)
sudo ufw allow 4097/tcp
# CentOS/RHEL (firewalld)
sudo firewall-cmd --permanent --add-port=4097/tcp
sudo firewall-cmd --reload
# iptables
sudo iptables -A INPUT -p tcp --dport 4097 -j ACCEPT┌──────────────────────────────────────────────────────────────────┐
│ Your Computer │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ Next.js Dashboard │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ File │ │ System │ │ Terminal │ │ OpenCode │ │ │
│ │ │ Browser │ │ Monitor │ │ (xterm) │ │ Manager │ │ │
│ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │
│ │ │ │ │ │ │ │
│ │ └──────────────┴──────────────┴──────────────┘ │ │
│ │ │ │ │
│ │ API Routes / Proxy │ │
│ └───────────────────────────┼──────────────────────────────────┘ │
└──────────────────────────────┼──────────────────────────────────────┘
│ HTTPS/WSS
▼
┌──────────────────────────────────────────────────────────────────┐
│ Your Server │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ Go Agent (:4097) │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Files │ │ Metrics │ │ PTY │ │ Service │ │ │
│ │ │ API │ │Collector │ │ Handler │ │ Manager │ │ │
│ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │
│ │ │ │ │ │ │ │
│ │ ▼ ▼ ▼ ▼ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │Filesystem│ │ /proc │ │ bash │ │ systemd │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ OpenCode AI (:4096) │ │
│ └────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘
opencode-dashboard/
├── src/ # Next.js Dashboard
│ ├── app/ # App Router pages
│ │ ├── (auth)/ # Authentication pages
│ │ ├── (dashboard)/ # Protected dashboard pages
│ │ └── api/ # API routes (proxy to agent)
│ ├── components/ # React components
│ │ ├── file-browser/ # File management UI
│ │ ├── monitoring/ # System metrics charts
│ │ ├── opencode/ # OpenCode management
│ │ ├── setup/ # Setup wizard
│ │ └── terminal/ # xterm.js terminal
│ ├── lib/ # Utilities and clients
│ │ ├── agent/ # Agent API client
│ │ ├── auth/ # Authentication logic
│ │ └── opencode/ # OpenCode SDK integration
│ └── hooks/ # Custom React hooks
├── opencode-agent/ # Go Agent
│ ├── cmd/agent/ # Entry point
│ └── internal/ # Internal packages
│ ├── api/ # HTTP handlers
│ ├── config/ # Configuration
│ ├── files/ # File operations
│ ├── metrics/ # System metrics collector
│ ├── terminal/ # PTY/WebSocket handler
│ └── workspace/ # Container management
├── scripts/ # Installation scripts
│ └── install-agent.sh # Production installer
└── .github/workflows/ # CI/CD pipelines
└── agent-release.yml # Auto-build on release
All API requests require the Authorization header:
Authorization: Bearer <your-token>
GET /api/healthReturns agent status and version information.
GET /api/metricsReturns CPU, memory, disk usage, and system load.
Response:
{
"cpu": {
"usage": 23.5,
"cores": 8
},
"memory": {
"total": 16777216000,
"used": 8388608000,
"percent": 50.0
},
"disk": {
"total": 500000000000,
"used": 250000000000,
"percent": 50.0
},
"load": {
"load1": 1.5,
"load5": 1.2,
"load15": 1.0
}
}GET /api/files?path=/home/user
GET /api/files/content?path=/home/user/file.txt
POST /api/files/write
POST /api/files/delete
POST /api/files/rename
POST /api/files/mkdirGET /api/service/status
POST /api/service/start
POST /api/service/stop
POST /api/service/restartWebSocket /api/terminal/wsFull PTY terminal access via WebSocket connection.
- Token-based authentication: 256-bit cryptographically secure tokens
- bcrypt password hashing: 12 rounds for dashboard login
- JWT session tokens: Secure, httpOnly cookies
- CORS protection: Configurable origin restrictions
- Path traversal protection: All paths validated against home directory
- Sensitive directory blocking:
.ssh,.gnupg,.aws,.config/gcloudblocked by default - Symlink resolution: Prevents escape via symbolic links
- TLS recommended: Use a reverse proxy (nginx, Caddy) with HTTPS in production
- Rate limiting: Built-in protection against brute force attacks
- Request validation: All inputs sanitized and validated
Workspaces use systemd-nspawn for secure isolation:
- Separate filesystem namespace
- Network isolation options
- Resource limits (CPU, memory)
- Capability dropping
- Go 1.21+ (for agent)
- Node.js 20+ or Bun (for dashboard)
- Make (for build scripts)
# Clone the repository
git clone https://github.com/itsmylife44/opencode-dashboard.git
cd opencode-dashboard
# Install dashboard dependencies
bun install
# Build the agent
cd opencode-agent
make build
cd ..
# Start both in development mode
./dev.sh# Dashboard tests
bun run test
# Agent tests
cd opencode-agent
go test ./...# Build dashboard
bun run build
# Build agent binaries
cd opencode-agent
make build-linux-amd64
make build-linux-arm64- TypeScript: ESLint + Prettier
- Go: gofmt + golint
- Commits: Conventional Commits format
Agent won't start:
# Check logs
sudo journalctl -u opencode-agent -f
# Verify token is set
cat ~/.config/opencode-agent/token
# Check port availability
sudo lsof -i :4097Connection refused:
# Check if agent is running
sudo systemctl status opencode-agent
# Check firewall
sudo ufw status
sudo iptables -L -n | grep 4097Can't connect to agent:
- Verify the agent URL is correct (include
http://) - Check the auth token matches
- Ensure port 4097 is open on the server
- Try
curl http://your-server:4097/api/healthto test connectivity
Authentication failed:
# Reset dashboard credentials
rm ~/.opencode-dashboard/credentials.json
rm ~/.opencode-dashboard/.setup.lock
# Restart dashboard and re-run setupWorkspace commands fail:
# Check dependencies
which systemd-nspawn debootstrap
# Install missing dependencies
sudo apt install systemd-container debootstrap # Ubuntu/Debian
sudo dnf install systemd-container debootstrap # Fedora
sudo pacman -S systemd debootstrap # Arch
# Check workspace directory permissions
ls -la ~/.opencode-workspacesContributions are welcome! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCode AI - The AI coding assistant this dashboard manages
- Next.js - React framework for the dashboard
- Chi Router - Lightweight Go HTTP router
- xterm.js - Terminal emulator for the web