OpenCode Portal provides a mobile-first web UI for OpenCode. This guide covers local installation and setup.
Prerequisites
Before installing OpenCode Portal, you need to have OpenCode installed on your system.
Install OpenCode
Install OpenCode using one of the following methods: Install OpenPortal
You can either install OpenPortal globally or run it directly with bunx.Global Installation
OpenPortal works best when paired with Bun. Node.js may have some rough edges.
Run Without Installing
Alternatively, use bunx to run OpenPortal without installing: Start OpenPortal
Navigate to your project directory and start OpenPortal:This will:
- Start the OpenCode server (default port: 4000)
- Start the web UI (default port: 3000)
- Automatically find available ports if defaults are busy
You should see output like: Access the Web UI
Open your browser and navigate to:You can now interact with OpenCode through the web interface.
CLI Commands
OpenPortal provides several commands for managing instances:
Start OpenCode + Web UI
Starts both the OpenCode server and the web UI.
Start OpenCode Server Only
Starts only the OpenCode server without the web UI.
Stop Running Instances
Stops all running OpenPortal instances in the current directory.
List Running Instances
Displays all running OpenPortal instances with their status.
Clean Stale Entries
Removes stale configuration entries for stopped instances.
CLI Options
Customize OpenPortal behavior with these options:
Directory Options
Port Configuration
If the specified ports are busy, OpenPortal will automatically find available ports.
Network Configuration
Instance Naming
Help
Usage Examples
Basic Usage
Custom Ports
Server Only Mode
Instance Management
Troubleshooting
Port Already in Use
If the default ports are already in use, OpenPortal will automatically find available ports. You can also specify custom ports:
OpenCode Not Found
If you see an error about OpenCode not being found, ensure it’s installed globally:
Instance Already Running
If OpenPortal detects an instance already running for the directory, it will display the existing instance information instead of starting a new one.
To stop the existing instance:
Web Server Not Found
If you installed OpenPortal globally and see “Web server not found” errors, try reinstalling: