Back to Docs

Managing Tunnels

Create, configure, and manage your tunnel domains.

Prerequisites: Installing cloudflared

Tunnels require the cloudflaredtunnel client. The MR Coder extension will detect it automatically if installed — if not, you'll see a prompt with an install link. Install it for your OS:

macOS

Bash
brew install cloudflared

Or download the binary from the official downloads page.

Windows

Bash
# Using winget (recommended)
winget install Cloudflare.cloudflared

# Or using Chocolatey
choco install cloudflared

# Or using Scoop
scoop install cloudflared

After installing, open a new terminal and run cloudflared --version to verify.

Linux (Debian / Ubuntu)

Bash
# Add the package signing key
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | \
  sudo tee /usr/share/keyrings/cloudflare-main.gpg > /dev/null

# Add repository
echo "deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] \
  https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main" | \
  sudo tee /etc/apt/sources.list.d/cloudflared.list

# Install
sudo apt update && sudo apt install -y cloudflared

Linux (RHEL / Fedora / CentOS)

Bash
# Add repository
sudo rpm --import https://pkg.cloudflare.com/cloudflare-main.gpg
curl -fsSL https://pkg.cloudflare.com/cloudflared-ascii.repo | \
  sudo tee /etc/yum.repos.d/cloudflared.repo

# Install
sudo dnf install -y cloudflared

Linux (Arch)

Bash
yay -S cloudflared-bin
Verify installation: Run cloudflared --version in your terminal. You should see output like cloudflared version 2024.x.x. If the command is not found, ensure it's in your system PATH and restart your terminal.

Creating a Tunnel

You can create tunnels from two places:

  • VS Code— Click "Create Tunnel" in the Server Details panel. Choose a subdomain and ports.
  • Web Dashboard — Go to Tunnels → Create New and fill in the form.

Tunnel Limits by Plan

The number of tunnels you can create depends on your subscription plan:

PlanTunnelsDevicesCustom Subdomains
Free11No
Basic ($4/mo)55No
Pro ($9/mo)510Yes
Team ($29/mo)2050Yes

Free accounts get 1 device and 1 tunnel domain. Subscribe to unlock more. Manage your plan from Settings → Billing.

Subdomain Format

Tunnels get a subdomain under mr-coder.io. You can choose a custom prefix (e.g. my-workspace) or let the system generate a random one. Subdomains must be unique and contain only lowercase letters, numbers, and hyphens.

TEXT
https://my-workspace.mr-coder.io     ← your public URL
https://api-server.mr-coder.io       ← additional tunnel domain

Additional Tunnel Domains

Your first tunnel is your primary domain — it routes to your VS Code web server. If you need to expose other services running on different ports, you can create additional tunnel domains:

  • Dev server — Expose your front-end dev server (e.g. port 3000) so collaborators can preview your app in the browser.
  • API server — Expose your backend API (e.g. port 8080) for webhook testing or external integrations.
  • Database UI — Expose tools like Adminer or pgAdmin (e.g. port 8081) for remote database management.

Each additional domain gets its own unique subdomain and can be started/stopped independently. To create one:

  1. Open the Remote Tunnels panel in VS Code.
  2. Below your primary domain, click "Add Domain".
  3. Enter a subdomain name and the local port you want to expose.
  4. Optionally set an auto-expire timer (1 hour, 24 hours, or 7 days) for temporary tunnels.
  5. Click "Create" — the new domain is ready immediately.
Note:Each additional domain counts toward your plan's tunnel limit. For example, a Free plan allows 1 tunnel total. Basic and Pro plans allow 5 tunnels each, and Team allows 20.

Multi-Port Tunnels (Path-Based Routing)

As an alternative to creating separate domains for each service, you can use path-based routing on a single tunnel. This routes different URL paths to different local ports:

TEXT
my-workspace.mr-coder.io        → VS Code IDE  (port 18462)
my-workspace.mr-coder.io/api    → API server   (port 8080)
my-workspace.mr-coder.io/db     → Database UI  (port 8081)

Path-based routing uses a single subdomain and doesn't consume additional tunnel slots. Configure it from the tunnel settings in VS Code or the web dashboard.

Starting & Stopping

Tunnels start automatically when you activate them from VS Code or the dashboard. The extension runs cloudflared as a background process. Stopping a tunnel terminates the process and removes the DNS record.

If you close VS Code, the tunnel stops. Reopen VS Code and click "Connect" to restart it.

Auto-Expire Tunnels

For temporary sharing, set an auto-expire timer when creating a tunnel domain. Available options:

  • 1 hour — Quick demos or pair programming
  • 24 hours — Day-long collaboration
  • 7 days — Sprint-length testing
  • No expiry — Persistent tunnel (manual stop)

When a tunnel expires, its DNS record is removed, the cloudflared process is terminated, and the subdomain is freed for reuse.

Deleting a Tunnel

Deleting a tunnel removes the tunnel configuration, all DNS CNAME records, and the ingress rules. This action is permanent and frees the subdomain for reuse.