Skip to content
cloudflared-project

Configuration Reference

By default, cloudflared-project stores all project data under ~/.cloudflared/projects/, leveraging the existing directory created by cloudflared itself.

~/.cloudflared/projects/
└── <project-name>/
├── project.yaml # Project metadata
├── environments/
│ ├── dev.yaml # Dev tunnel config (cloudflared-native format)
│ ├── staging.yaml # Staging tunnel config
│ └── prod.yaml # Production tunnel config
└── logs/
├── dev.log # Logs for detached dev tunnel
└── prod.log # Logs for detached prod tunnel

Tip: Use --local on init to create a project in .cloudflared-project/ within the current directory. This is useful for monorepos where each service manages its own tunnel.


Stores metadata about the project. Created automatically by cloudflared-project init.

~/.cloudflared/projects/myapp/project.yaml
version: "1"
name: myapp
default_env: dev
FieldTypeDescription
versionstringSchema version. Currently "1".
namestringProject name. Must match the directory name.
default_envstringDefault environment when --env is not provided. Defaults to dev.

Environment Config Schema (environments/<env>.yaml)

Section titled “Environment Config Schema (environments/<env>.yaml)”

Each environment file is a standard cloudflared tunnel configuration that can be passed directly to cloudflared tunnel run --config. cloudflared-project reads and writes these files without any proprietary extensions.

~/.cloudflared/projects/myapp/environments/prod.yaml
tunnel: 550e8400-e29b-41d4-a716-446655440000
credentials-file: /home/user/.cloudflared/550e8400-e29b-41d4-a716-446655440000.json
ingress:
- hostname: myapp.example.com
service: http://localhost:8080
originRequest:
connectTimeout: 30s
tlsTimeout: 30s
noTLSVerify: false
- hostname: api.myapp.example.com
service: http://localhost:8081
- service: http_status:404
warp-routing:
enabled: false
FieldTypeRequiredDescription
tunnelstringYesTunnel UUID or name.
credentials-filestringYesAbsolute path to the tunnel credentials JSON file.
ingressIngressRule[]YesList of ingress rules. Must end with a catch-all rule.
originRequestOriginRequestNoDefault origin settings applied to all ingress rules. Can be overridden per-rule.
warp-routingWarpRoutingNoWARP routing configuration for private network access.
FieldTypeDescription
hostnamestringHostname to match (e.g., app.example.com). Omit for catch-all.
servicestringBackend service URL (e.g., http://localhost:3000) or status code (e.g., http_status:404).
pathstringOptional URL path prefix to match (e.g., /api).
originRequestOriginRequestPer-rule origin settings. Overrides top-level originRequest.

Note: The last ingress rule must be a catch-all (no hostname and no path). cloudflared-project config validate enforces this.

Controls how cloudflared connects to origin services.

FieldTypeDefaultDescription
connectTimeoutduration30sTCP connection timeout to origin.
tlsTimeoutduration10sTLS handshake timeout.
tcpKeepAliveduration30sTCP keep-alive interval.
noHappyEyeballsboolfalseDisable Happy Eyeballs (dual IPv4/IPv6 connection racing).
keepAliveTimeoutduration90sIdle keep-alive connection timeout.
keepAliveConnectionsint100Maximum number of keep-alive connections.
httpHostHeaderstringOverride the Host header sent to the origin.
originServerNamestringOverride the SNI hostname for TLS verification.
noTLSVerifyboolfalseDisable TLS certificate verification (not recommended for production).
disableChunkedEncodingboolfalseDisable chunked transfer encoding.
proxyAddressstringSOCKS or HTTP proxy address for origin connections.
proxyPortintProxy port.
proxyTypestringProxy type: socks or http.

Duration values use Go duration syntax: 10s, 1m, 500ms.

FieldTypeDefaultDescription
enabledboolfalseEnable routing of private network traffic through the tunnel (requires WARP client).

cloudflared-project resolves the active environment in this order:

  1. --env / -e flag (highest priority)
  2. CLOUDFLARED_PROJECT_ENV environment variable
  3. default_env in project.yaml
  4. Fallback to dev

All flags can be set via environment variables using the CLOUDFLARED_PROJECT_ prefix.

VariableEquivalent FlagDescription
CLOUDFLARED_PROJECT_ENV--envTarget environment
CLOUDFLARED_PROJECT_VERBOSE--verboseEnable verbose output
CLOUDFLARED_PROJECT_CLOUDFLARED_PATH--cloudflared-pathPath to cloudflared binary

Tunnel credentials (generated by cloudflared tunnel create) are stored as JSON files alongside environment configs:

environments/
├── dev.yaml # Tunnel config (safe to commit)
├── dev.json # Tunnel credentials (SECRET — do not commit)
├── prod.yaml # Tunnel config (safe to commit)
└── prod.json # Tunnel credentials (SECRET — do not commit)

Caution: The .json credentials files contain your tunnel secret. Add environments/*.json to your .gitignore. Never commit these files.

The credentials-file field in each environment YAML must point to the absolute path of the corresponding JSON file.