Skip to content
Cloudflare Docs

Setup

Create a Cloudflare Tunnel and publish your first application in under 5 minutes.

Prerequisites

Create a tunnel

To create a new Cloudflare Tunnel:

  1. In the Cloudflare dashboard, go to Networking > Tunnels.

    Go to Tunnels
  2. Select Create Tunnel.

  3. Enter a name for your tunnel (for example, production-web or staging-api).

  4. Select Create Tunnel.

  5. Under Setup Environment, select the operating system and architecture of your server.

  6. Copy the install commands shown under Install and Run and run them in a terminal on your server.

  7. Once the tunnel connects, select Continue.

Your tunnel should appear on the Tunnels page with a Healthy status.

Publish an application

To make an application accessible from the Internet, add a published application route to your tunnel. The tunnel route maps a public hostname to a local service.

  1. In the Cloudflare dashboard, go to Networking > Tunnels and select your tunnel. Go to Tunnels

  2. Under Routes, select Add route.

  3. Select Published application.

  4. Under Hostname, enter a subdomain and select a domain from the drop-down menu.

  5. For Service URL, enter the local address and port of your application.

    For example, if your web server runs on the same machine as cloudflared:

    • HTTP on port 80: http://localhost:80
    • HTTPS on port 443: https://localhost:443

    If your web server runs on a different machine: http://192.0.2.1:80

  6. Select Add route.

Your application is now live at the hostname you configured. Cloudflare automatically proxies traffic through its network, applying CDN caching, WAF, and DDoS protection.

Quick tunnels (development)

For local development, you can instantly expose localhost without a Cloudflare account:

Terminal window
cloudflared tunnel --url http://localhost:8080

This generates a random trycloudflare.com subdomain that proxies traffic to your local server. Quick tunnels are for testing only — they have a 200 concurrent request limit and do not support Server-Sent Events (SSE).

For production use, create a tunnel instead.

Next steps

  • Routing — Configure DNS records, load balancers, and protocol support.
  • Configuration — Deploy replicas, manage tokens, and tune performance.
  • Deployment guides — Deploy on Kubernetes, AWS, GCP, Terraform, and more.
  • Troubleshooting — Resolve common errors and connectivity issues.