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