Serious Issues with Uninstalling Cloudflared & Tunnel

Ubuntu Server 22.04 LTS

Running Pterodactyl instance on same server.
Tunnel removed from Zero Trust

Unable to create new service for Cloudflared or uninstall “existing” service. I have tried using the following command

cloudflared service uninstall

I have also tried the above command using sudo too.

When running this command, I am met with the following;

2023-09-30T07:37:35Z INF Using Systemd
2023-09-30T07:37:35Z INF Service 'cloudflared.service' not installed, skipping its uninstall
2023-09-30T07:37:35Z INF Service 'cloudflared-update.service' not installed, skipping its uninstall
2023-09-30T07:37:35Z INF Service 'cloudflared-update.timer' not installed, skipping its uninstall
2023-09-30T07:37:35Z INF Linux service for cloudflared uninstalled successfully

It looks all well and good, however after trying to re-install cloudflared & tunnel (I’m uninstalling as something has broken) it is unable to install.

Install command (from cloudflare directly)

sudo cloudflared service install (key goes here)

I am however met with this message;

2023-09-30T07:28:33Z INF Using Systemd
2023-09-30T07:28:33Z ERR error generating service template error="cloudflared service is already installed at /etc/systemd/system/cloudflared.service; if you are running a cloudflared tunnel, you can point it to multiple origins, avoiding the need to run more than one cloudflared service in the same machine; otherwise if you are really sure, you can do `cloudflared service uninstall` to clean up the existing service and then try again this command"
cloudflared service is already installed at /etc/systemd/system/cloudflared.service; if you are running a cloudflared tunnel, you can point it to multiple origins, avoiding the need to run more than one cloudflared service in the same machine; otherwise if you are really sure, you can do `cloudflared service uninstall` to clean up the existing service and then try again this command

Thank you in advance to anyone who aids in a fix for this.
Cheers, tismelyla

These steps should help:

  1. Remove the service file manually using the rm command:
sudo rm /etc/systemd/system/cloudflared.service
  1. Reload the systemd manager configuration:
sudo systemctl daemon-reload
  1. After that, try installing it again with your original install command:
sudo cloudflared service install (key goes here)
2 Likes

Hi All,
How do i remove this service from a windows 10 machine?