C
Docs

ngrok Setup

Configure ngrok for secure remote access to C3.

Overview

ngrok creates secure tunnels to expose your local C3 server to the internet. This allows you to connect from anywhere, not just your local network.

Getting Started

1

Create ngrok Account

Sign up at ngrok.com for a free account.

2

Get Auth Token

Find your authtoken in the ngrok dashboard under "Your Authtoken".

3

Start C3 with ngrok

ccc --ngrok-token YOUR_TOKEN -u admin -p password

Security Reminder

C3 won't start the server unless authentication (username/password) is set. This is crucial to prevent unauthorized access when exposing your server to the internet.

Configuration

# Basic ngrok setup
ccc --ngrok-token YOUR_TOKEN \
    --username admin \
    --password your_secure_password

# Or use environment variables
export CCC_NGROK_TOKEN=your_token
export CCC_USERNAME=admin
export CCC_PASSWORD=your_password
ccc

Static Domains

By default, ngrok generates random URLs that change each time you restart. However, ngrok's free tier includes one free static dev domain, which keeps your URL consistent across restarts.

Finding Your Free Dev Domain

Your dev domain is automatically assigned when you create your ngrok account. To find it:

  1. Log in to your ngrok dashboard at dashboard.ngrok.com/domains
  2. Look for your dev domain (it will be on an ngrok-free.dev base domain)
  3. Copy your assigned domain (e.g., abc123xyz.ngrok-free.dev)

Free Plan Limits

The free plan includes 1GB bandwidth/month, 20,000 HTTP requests/month, and up to 3 concurrent endpoints. HTTP endpoints display a browser warning page that visitors must click through (can be bypassed with an HTTP header for API calls).

Using Your Static Domain

ccc --ngrok-token YOUR_TOKEN \
    --ngrok-domain abc123xyz.ngrok-free.dev \
    -u admin -p password

With a static domain, your URL stays the same, so you don't need to reconfigure the mobile app after restarting the server.

Recommended Setup

We highly recommend claiming your free static domain. Without it, you'll need to scan a new QR code or update your server profile every time you restart C3.

Alternative Options

While ngrok is the easiest option with built-in C3 support, there are other ways to access your C3 backend remotely. These alternatives require manual setup but may better suit your needs.

Cloudflare Tunnel

Cloudflare Tunnel (formerly Argo Tunnel) provides secure tunneling with Cloudflare's network.

  • Free tier: Up to 50 users, 1000 tunnels, no bandwidth limits
  • Pros: No bandwidth limits, uses your custom domain, additional security features
  • Cons: Requires a domain managed by Cloudflare, more complex setup
# Install cloudflared
# macOS
brew install cloudflared

# Then authenticate and create a tunnel
cloudflared tunnel login
cloudflared tunnel create ccc-tunnel

# Run the tunnel pointing to C3's router port
cloudflared tunnel run --url http://localhost:8883 ccc-tunnel

Tailscale

Tailscale creates a private mesh VPN network between your devices using WireGuard.

  • Free tier: Up to 100 devices, 3 users
  • Pros: No port exposure to internet, peer-to-peer connections, easy setup
  • Cons: Requires Tailscale app on both devices, not publicly accessible

With Tailscale, install the app on both your development machine and mobile device. Then connect to C3 using your machine's Tailscale IP address (e.g., http://100.x.x.x:8883).

Tailscale on iOS/Android

Tailscale has native apps for iOS and Android. Once connected to your Tailnet, your phone can reach your development machine's local services as if on the same network.

ZeroTier

ZeroTier is another mesh VPN solution similar to Tailscale.

  • Free tier: Up to 10 devices, 3 networks (for new accounts)
  • Pros: Self-hostable, more control over network configuration
  • Cons: Slightly more complex than Tailscale, lower free tier limits

Port Forwarding

If you have access to your router, you can forward ports to expose C3 directly.

  • Pros: No third-party services, full control
  • Cons: Requires static IP or dynamic DNS, security risks, router access needed

Security Warning

Port forwarding exposes your machine directly to the internet. Only use this option if you understand the security implications. Always use strong authentication credentials and consider additional firewall rules.

Comparison

OptionSetupFree TierBest For
ngrokEasiest1GB/mo, 20k req/moQuick setup, built-in C3 support
Cloudflare TunnelModerate50 users, unlimited BWCustom domain, no bandwidth limits
TailscaleEasy3 users, 100 devicesPrivate access, maximum security
ZeroTierModerate10 devices, 3 networksSelf-hosted, more control
Port ForwardingComplexN/AFull control, no third parties