Portal
Setup

Remote Setup

Setting up OpenCode Portal on a remote server with Tailscale

Remote Setup

Access Portal from anywhere by running it on a VPS or home server with Tailscale.

Architecture

[Your Phone/Laptop] ---(Tailscale VPN)---> [VPS running Portal + OpenCode]

This setup allows you to:

  • Code from your phone or tablet
  • Access your development environment from anywhere
  • Keep your projects running on a powerful server

Prerequisites

On your remote server:

  1. OpenCode installed
  2. Bun installed (recommended)
  3. Tailscale installed and connected

Note: OpenPortal works best when paired with Bun. Node.js may have some rough edges.

Server Setup

1. Install Bun

curl -fsSL https://bun.sh/install | bash

2. Install OpenCode

# Using curl (macOS/Linux)
curl -fsSL https://opencode.ai/install | bash

# Or using bun
bun install -g opencode

3. Install Portal globally

bun install -g openportal

4. Install and configure Tailscale

# Install Tailscale
curl -fsSL https://tailscale.com/install.sh | sh

# Start Tailscale and authenticate
sudo tailscale up

Follow the authentication link that appears to connect your server to your Tailnet.

5. Run Portal

Navigate to your project and start Portal:

cd /path/to/your/project
openportal

Portal will display the URLs where you can access it.

Client Access

1. Install Tailscale on your device

Download Tailscale for your device:

2. Connect to your Tailnet

Open Tailscale and sign in with the same account you used on your server.

3. Access Portal

Once connected, you can access Portal using any of these methods:

Using Tailscale IP

Find your server's Tailscale IP:

tailscale ip -4

Then access Portal at:

http://100.x.x.x:3000

Tailscale's MagicDNS lets you access devices by hostname. If your server is named myserver, access Portal at:

http://myserver:3000

To check or set your machine name:

# Check current hostname
tailscale status

# Set a custom hostname
sudo tailscale set --hostname=myserver

Using Tailnet Domain

For a fully qualified domain name, use your Tailnet name:

http://myserver.tailnet-name.ts.net:3000

Find your Tailnet name in the Tailscale admin console under DNS settings.

Running as a Service

To keep Portal running after you disconnect, use a process manager like PM2:

# Install PM2
bun install -g pm2

# Start Portal with PM2
cd /path/to/your/project
pm2 start openportal --name portal

# Save the process list
pm2 save

# Setup startup script
pm2 startup

Managing the service

# Check status
pm2 status

# View logs
pm2 logs portal

# Restart
pm2 restart portal

# Stop
pm2 stop portal

Managing Multiple Projects

Portal supports multiple instances. Use the --name flag to identify each:

# Start Portal for different projects
cd /project-a && openportal --name project-a --port 3001
cd /project-b && openportal --name project-b --port 3002

# List all running instances
openportal list

# Stop a specific instance
openportal stop --name project-a

Access each project via MagicDNS:

http://myserver:3001  # project-a
http://myserver:3002  # project-b

Security Considerations

  • Tailscale provides end-to-end encryption
  • Portal is only accessible via your Tailscale network
  • No ports need to be exposed to the public internet
  • Consider using Tailscale ACLs for additional access control

On this page