Skip to content
Cloudflare Docs

Useful commands

This page lists the most commonly used commands for managing local tunnels.

To view all CLI commands, refer to the CLI help text in your terminal. For example, to view all options for the cloudflared tunnel subcommand, type cloudflared tunnel help.

Manage cloudflared

CommandDescription
cloudflared updateLooks for a new version on the official download server. If a new version exists, it updates the agent binary and quits. Otherwise, no action is performed. This command only works if cloudflared was installed from GitHub binaries or from source. For more information, refer to the update instructions.
cloudflared versionPrints the cloudflared version number and build date.
cloudflared helpShows a list of all top-level commands for cloudflared.

Manage tunnels

CommandDescription
cloudflared tunnel loginPrompts a browser window where you can authenticate your tunnel to your Cloudflare account.
cloudflared tunnel listDisplays all active tunnels, their creation time, and associated connections. Use the -d flag to include deleted tunnels.
cloudflared tunnel create <NAME or UUID>Creates a tunnel, registers it with the Cloudflare edge and generates a credential file to run this tunnel.
cloudflared tunnel --config path/config.yaml run <NAME or UUID>Runs a tunnel, creating highly available connections between your server and the Cloudflare edge. You can provide name or UUID of the tunnel to run either as the last command line argument or in the configuration file using tunnel: <NAME>.
cloudflared tunnel info <NAME or UUID>Displays details about the active connectors for a given tunnel identified by name of UUID.
cloudflared tunnel cleanup <NAME or UUID>Deletes connections for tunnels with the given UUIDs or names. This is useful if you get an error trying to delete or run a tunnel after cloudflared is not shut down gracefully (for example, if a kill command is issued).
cloudflared tunnel cleanup --connector-id <CONNECTOR-ID> <NAME or UUID>Disconnects and deletes a cloudflared replica with the given connector ID. You can view all replicas for a tunnel by running cloudflared tunnel info <NAME or UUID>.
cloudflared tunnel delete <NAME or UUID>Deletes tunnels with the given name or UUID. A tunnel cannot be deleted if it has active connections. To delete the tunnel unconditionally, use the -f flag.
cloudflared tail <UUID>Start a session to livestream logs from a specific tunnel. For more information, refer to Tunnel logs.

Manage published applications

CommandDescription
cloudflared tunnel route dnsCreates a DNS CNAME record hostname that points to the tunnel.
cloudflared tunnel route lb <NAME or UUID> <hostname> <load balancer pool>Adds a tunnel as an endpoint in a load balancer pool. A new load balancer and pool will be created if necessary.
  • <hostname>: the public-facing hostname of the load balancer, for example lb.example.com
  • <load balancer pool>: the name of the pool that will contain the tunnel endpoint
To load balance traffic to a published application, you will also need to specify the application hostname in the endpoint host header using the dashboard or API.