How to make cloudflared access persistent?

What is the name of the domain?

vm.lebearcnc.com

What is the error number?

No error

What is the error message?

no error message

What is the issue you’re encountering

Right now, I can sftp to my local machine from my remote server, but I have to keep the client terminal open. I would like to be able to not depend on an open terminal for this to work.

What steps have you taken to resolve the issue?

I read all that I could find about this, but not seen any proper answer. To make the tunnel work, I typed, on the client side “sudo cloudflared access tcp --hostname vm.lebearcnc.com --url localhost:22”. But if I type another command, or close the terminal, the web socket listener stop to listen. It’s working perfectly for my need, but I would like this to be more persistent and “fool proof”, the fool being me :slight_smile:

What are the steps to reproduce the issue?

setup a sftp cloudflared tunnel between server and client. (both ubuntu 24.04)

Ideally, you’d set up a systemd service that runs the command on system start.

thank you for your answer @Laudian , I can search on how to do this. But, even if it starts automatically with the system, will that make it persistent ? I know a service is, and this is the way cloudflared is setup on the server side. Ok, I guess i need too learn about setting up a service. Thans again.

1 Like

There’s not much to it.

Copy the service file (/etc/systemd/system/cloudflared.service) that you have on the server and paste it on your client.

Change the ExecStart command to what you’re using on your client and that’s it.

Edit: Probably better to also copy the update file in the same directory :wink:

1 Like

Thank you very much. Don’t know why I did not even think to just copy the service from the server ! I created a new service after some googling around, and it seems to work just fine (so far :wink: )
Well, it’s a first for me ! Thanks again, I really learned something today.

1 Like