# 使用 Homebrew, apk, chocolatey, MacPorts, Nix, pacman, zypper, scoop, winget 安装 cloudflared

查看 cloudflared 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:cloudflared
```

## 代理安全回答

cloudflared manages tunnels, DNS-facing connectivity, and Cloudflare access paths.

- **凭据访问:** Reads tunnel credentials, Cloudflare tokens, and local tunnel config.
- **远程变更:** Can create tunnels, route traffic, and update service exposure.
- **发布/制品风险:** Can expose local or internal services to the network.
- **推荐控制:** Gate tunnel creation, route changes, token use, and service exposure.
- **代理使用指南:** Allow tunnel status checks; require approval before exposing endpoints or changing routes.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cloudflared
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cloudflared
```

  证据: MacPorts ports tree: net/cloudflared/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add cloudflared
```

  证据: Alpine Linux edge package indexes: cloudflared from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#cloudflared
```

  证据: nixpkgs package indexes: pkgs/by-name/cl/cloudflared/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S cloudflared
```

  证据: Arch Linux sync databases: cloudflared from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install cloudflared
```

  证据: openSUSE Tumbleweed package metadata: cloudflared from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install cloudflared
```

  证据: Chocolatey community package catalog: cloudflared from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','chocolatey-misc-helpers.extension'

- Scoop (92%):

```sh
scoop install main/cloudflared
```

  证据: Scoop official bucket manifest trees: bucket/cloudflared.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Cloudflare.cloudflared -e
```

  证据: Windows Package Manager source index: Cloudflare.cloudflared from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:cloudflared
- **软件包管理器:** Homebrew
- **版本:** 2026.7.3
- **来源摘要:** Cloudflare Tunnel client (formerly Argo Tunnel)
- **主页:** <https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/>
- **仓库:** <https://github.com/cloudflare/cloudflared>
- **最后更新:** 2026-07-23T12:10:11Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cloudflared (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2026.7.3
## 项目历史与用法

cloudflared is Cloudflare's Tunnel client, the daemon/CLI that establishes outbound-only connections from private infrastructure to Cloudflare's network. It grew out of the Argo Tunnel product line and became a central piece of Cloudflare One and Zero Trust access patterns.

### 项目历史

The official cloudflared repository was created in 2017, matching the period when Cloudflare was turning Argo Tunnel into a packaged client. Cloudflare now documents Cloudflare Tunnel as a connector that lets origins and private networks reach Cloudflare without opening inbound firewall ports.

The tool's role expanded from origin tunneling for web apps into a general Zero Trust connector: it can run as a service, authenticate tunnels with credential files, and support remotely managed tunnels through Cloudflare's dashboard and API.

### 采用历史

cloudflared has unusually broad package-manager coverage for a vendor network daemon. The batch package metadata lists apk, Homebrew, Chocolatey, MacPorts, Nix, pacman, Scoop, winget, and zypper, reflecting demand across Linux servers, macOS developer machines, and Windows desktops.

Cloudflare's documentation and release cadence make cloudflared a common dependency in homelab, self-hosting, Kubernetes, CI, and enterprise Zero Trust deployments where operators want a reverse tunnel without exposing origin services directly.

### 使用方式

Operators use cloudflared to create, run, and supervise Cloudflare Tunnel connectors. Typical workflows include logging in, creating a tunnel, writing config.yml, storing a tunnel credentials JSON file, and running cloudflared as a foreground process or system service.

The same executable also covers DNS-over-HTTPS proxying and other Cloudflare network utility tasks, but the Homebrew package is primarily significant as the Cloudflare Tunnel client.

### 为什么软件包爱好者会关心

cloudflared is a good example of a cloud vendor shipping a cross-platform networking daemon through mainstream package managers instead of only tarballs or curl-piped installers. Formula maintainers care about service integration, binary update speed, and config/credential paths because it is often run unattended.

Its packaging surface is broader than many cloud CLIs because it serves both developers and infrastructure operators: the same package can be used interactively on a laptop or as a long-running connector on a server.

### 时间线

- 2017: Official cloudflared GitHub repository was created.
- 2020: Public GitHub releases for cloudflared were available in the 2020.6.x line.
- 2022: Cloudflare Tunnel became part of the broader Cloudflare One connector documentation and product surface.
- 2026: cloudflared continued a date-versioned release cadence, including 2026.6.x releases.

### Related projects

- Cloudflare Tunnel is the product surface that cloudflared implements as a connector.
- Cloudflare Access and Zero Trust policies commonly sit in front of applications exposed through cloudflared.
- Wrangler overlaps in the Cloudflare CLI ecosystem but is focused on Workers development rather than tunnel operations.

### 来源

- <https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/>
- <https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/local-management/configuration-file/>
- <https://github.com/cloudflare/cloudflared>


## 安全说明

formula declares a Homebrew service. infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- formula declares a Homebrew service
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.cloudflared/config.yml, $XDG_CONFIG_HOME/cloudflared/config.yml, ~/.config/cloudflared/config.yml

## Credential files

- Unix: ~/.cloudflared/cert.pem, ~/.cloudflared/*.json, $XDG_CONFIG_HOME/cloudflared/cert.pem, $XDG_CONFIG_HOME/cloudflared/*.json, ~/.config/cloudflared/cert.pem, ~/.config/cloudflared/*.json
## 其他软件包管理器记录

- Nix - cloudflared: normalized package name match | nixpkgs package indexes: pkgs/by-name/cl/cloudflared/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cloudflared - 2026.6.0-r1: normalized package name match | Alpine Linux edge package indexes: cloudflared from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Cloudflare Tunnel client | https://github.com/cloudflare/cloudflared
- apk - cloudflared-doc - 2026.6.0-r1: normalized package name match | Alpine Linux edge package indexes: cloudflared-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Cloudflare Tunnel client (documentation) | https://github.com/cloudflare/cloudflared
- apk - cloudflared-openrc - 2026.6.0-r1: normalized package name match | Alpine Linux edge package indexes: cloudflared-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Cloudflare Tunnel client (OpenRC init scripts) | https://github.com/cloudflare/cloudflared
- pacman - cloudflared - 2026.7.3-1: normalized package name match | Arch Linux sync databases: cloudflared from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Command-line client for Cloudflare Tunnel | https://github.com/cloudflare/cloudflared
- zypper - cloudflared - 2026.5.2-1.4: normalized package name match | openSUSE Tumbleweed package metadata: cloudflared from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Cloudflare Tunnel client | https://github.com/cloudflare/cloudflared
- MacPorts - cloudflared: normalized package name match | MacPorts ports tree: net/cloudflared/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - cloudflared: normalized package name match | Chocolatey community package catalog: cloudflared from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','chocolatey-misc-helpers.extension'
- Scoop - main/cloudflared: normalized package name match | Scoop official bucket manifest trees: bucket/cloudflared.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Cloudflare.cloudflared: normalized package name match | Windows Package Manager source index: Cloudflare.cloudflared from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/cloudflared.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cloudflared.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
