OpenCode Portal is designed for remote access to your OpenCode instance. This guide shows you how to deploy the portal on a VPS and access it securely from your mobile device or any other machine using Tailscale.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hosenur/portal/llms.txt
Use this file to discover all available pages before exploring further.
Use Case
This setup allows you to:- Access OpenCode from your mobile device when you don’t have your laptop
- Work on code from anywhere with an internet connection
- Share OpenCode access with team members securely
Prerequisites
- A VPS or remote server (Ubuntu, Debian, or similar)
- SSH access to your server
- A Tailscale account (free tier available)
Setup Steps
Install Bun on Your Server
SSH into your server and install Bun:Add Bun to your PATH (if not done automatically):Add these lines to your
~/.bashrc or ~/.zshrc to make them permanent.Install and Configure Tailscale
Install Tailscale on your server:Start and authenticate Tailscale:Follow the authentication URL to connect your server to your Tailscale network.Get your server’s Tailscale IP:Note this IP address - you’ll use it to access OpenPortal.
Start OpenPortal on Your Server
Navigate to your project directory and start OpenPortal:For production use, you’ll want to keep it running in the background. See the Process Management section below.
Install Tailscale on Your Mobile Device
Install the Tailscale app on your phone:
- iOS: Download from the App Store
- Android: Download from Google Play
Network Configuration
Binding to All Interfaces
By default, OpenPortal binds to0.0.0.0 (all network interfaces), which allows access from Tailscale.
If you want to bind to a specific interface:
Custom Ports
If you need to use different ports:Process Management
For production use, you’ll want OpenPortal to run persistently in the background.Using systemd
Create a systemd service file:Using screen
For a simpler approach, usescreen:
Using tmux
Alternatively, usetmux:
Security Considerations
Tailscale Security
Tailscale provides secure, encrypted connections between your devices:- All traffic is encrypted using WireGuard
- Only devices in your Tailscale network can access your server
- No need to expose ports to the public internet
Additional Security Measures
If you need to expose OpenPortal publicly:- Use a reverse proxy (nginx, Caddy) with HTTPS
- Add authentication (basic auth, OAuth)
- Configure firewall rules to restrict access
- Use strong passwords for your OpenCode instances
Monitoring and Maintenance
Check Running Instances
View Logs (systemd)
Restart After Updates
After updating OpenPortal:Troubleshooting
Cannot Connect from Mobile Device
- Verify Tailscale is connected on both devices
- Check your server’s Tailscale IP:
tailscale ip -4 - Ensure OpenPortal is running:
openportal list - Verify the port is correct (default: 3000)
Tailscale Connection Issues
OpenPortal Service Not Starting
Next Steps
- Explore Docker deployment for containerized setups
- Configure multiple project instances with custom names
- Set up automated backups for your project files