How do I run cloudflared tunnel in the background as a service?

Question

Grade: Education Subject: Support
How do I run cloudflared tunnel in the background as a service?
Asked by:
63 Viewed 63 Answers

Answer (63)

Best Answer
(336)
To run cloudflared as a service, you'll typically use a systemd unit file. Cloudflare provides example unit files for various operating systems. After creating the unit file (e.g., `/etc/systemd/system/cloudflared.service`), enable and start the service with `sudo systemctl enable cloudflared` and `sudo systemctl start cloudflared`.