Skip to content

Instantly share code, notes, and snippets.

@supersonictw
Last active February 1, 2026 05:29
Show Gist options
  • Select an option

  • Save supersonictw/a19ca7eb887f62ef874ef8678da39cb8 to your computer and use it in GitHub Desktop.

Select an option

Save supersonictw/a19ca7eb887f62ef874ef8678da39cb8 to your computer and use it in GitHub Desktop.
CloudFlared OpenRC for Alpine Linux wget -O - https://ncurl.xyz/s/rbRXZzVDR | sh
#!/sbin/openrc-run
# CloudFlared OpenRC for Alpine Linux
# https://github.com/cloudflare/cloudflared
# SPDX-License-Identifier: Apache-2.0
cloudflare_token="YOUR_TOKEN_HERE"
#!/sbin/openrc-run
# CloudFlared OpenRC for Alpine Linux
# https://github.com/cloudflare/cloudflared
# SPDX-License-Identifier: Apache-2.0
name=$(basename $(readlink -f $0))
command="/usr/local/bin/cloudflared"
command_args="--no-autoupdate tunnel run --token $cloudflare_token"
command_user="cloudflared"
command_background="yes"
pidfile="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"
start_pre() {
checkpath -f -m 0644 -o "$command_user:$command_user" "/var/log/$name.log"
checkpath -f -m 0644 -o "$command_user:$command_user" "/var/log/$name.err"
}
#!/bin/sh
# CloudFlared OpenRC for Alpine Linux
# https://github.com/cloudflare/cloudflared
# SPDX-License-Identifier: Apache-2.0
wget -O "/etc/conf.d/cloudflared" "https://ncurl.xyz/s/vKClxaFNg"
wget -O "/etc/init.d/cloudflared" "https://ncurl.xyz/s/7SCQZz4DR"
chown root:root "/etc/conf.d/cloudflared" "/etc/init.d/cloudflared"
chmod +x "/etc/init.d/cloudflared"
addgroup -S cloudflared
adduser -S -H -s "/bin/ash" -h "/dev/null" -g cloudflared -G cloudflared cloudflared
echo "Done."
@supersonictw
Copy link
Author

supersonictw commented Feb 7, 2025

To install cloudflared

wget -O /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x /usr/local/bin/cloudflared

To enable cloudflared

rc-update add cloudflared
rc-update cloudflared start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment