Creating cloudflared tunnel on ubuntu 22.04

Visit https://pkg.cloudflare.com to add the cloudflared repository. Run sudo apt-get update && sudo apt-get install cloudflared to install cloudflared

Visit Cloudflare Package Repository to add the cloudflare warp repository and then run sudo apt install cloudflare-warp to install warp.

Run cloudflared tunnel login to log in with the CF account.

cloudflared tunnel create yourunnelname to create a cloudflare tunnel. A xxxx.json file and cert.pem file will be created. Copy the file name of the xxx.json

cd .cloudflared && nano config.yml

put the following content in the file:


如果出现wordpress提示Publishing failed. You are probably offline.说明需要手动申请SSL证书。通过下面命令安装certbot申请即可:

sudo snap install core; sudo snap refresh core 
sudo snap install --classic certbot 
sudo ln -s /snap/bin/certbot /usr/bin/certbot 
sudo certbot --nginx -d domain.tld