I put Claude Code in Telegram, and it runs my business 24/7 (setup guide)

Set up Claude Code on a VPS and control it through Telegram to automate your business 24/7. Clone a GitHub template with your brand voice and business info, install the Telegram plugin, pair your bot, and run commands from anywhere. Tasks like app building, scraping, and email handling work the same as in VS Code.
Chapters
I have Claude Code inside of my Telegram and it runs my business pretty much 24/7. And in this video, I'm going to show you exactly how you can set it up for yourself. So right now you probably use Claude Code like this where you have it connected up to your laptop or your computer and you simply just use it through something like VS Code. And this is obviously great, but of course you can't use it through your phone. And also when you close your laptop down, that's it, the session ends. It can't run in the background. It needs your laptop there so it can actually run. But what we're going to be doing in this video is a setup that's more like this where you have your computer and you connect it once to Telegram. So you only have to do this one time. Your computer isn't actually involved in the process, but you have it connected to Telegram, and then Telegram is connected up to a VPS that's connected up to Claude Code and GitHub. So they're all linked together. So basically what this means is you can use Claude Code through anywhere. For this video, we're going to be using it through Telegram, but you can use it through anywhere. And what you usually see on your laptop, it's going to be running on a VPS, which means you can text it in the middle of nowhere, as long as you have got Wi-Fi so the text can go through on Telegram, then this thing can run 24/7. Doesn't need your laptop to be open, doesn't need your phone to be on, anything like that. But it's going to work in the exact same way as how you currently use Claude Code, where it can build apps, create automations, absolutely everything, rather than doing that actually on your computer. It's just going to be doing it through a VPS. So this is a setup that we're going to be using in this video. Let's say this here is your personal Claude Code setup. So for me, it's kind of similar to my personal Claude Code setup, but of course there are a few things missing. And what we're to do is basically put this setup here into a GitHub repo, and then we're going to connect that and host it on a VPS. And then we're going to connect Claude Code to that VPS so it has access to all these files and it can do things inside of them. And then we're going to connect all of that up to Telegram so we can actually talk to it. So just to quickly run you through, this is how a project like this or a workspace like this might look. We just have some context files here, and these haven't been filled in. By the way, if you want to grab this template, just check the link in the description of this video. You'll be able to get it for free. So you can get started straight away. And it has everything built in here that I'm going to walk you through in terms of actually setting this up on a VPS. So we have things like our brand voice, our business information, our clients, our current data, our personal information, strategy team, things like this. These are the context files that I have in my personal Claude Code setup, but you can see none of these are filled out. So of course, when you go ahead and download the template, you fill all of these out yourself. And then if there's anything else you want to have in here, like your skills, your commands, your workflows, any apps you've been working on, literally anything, it doesn't matter. As long as it works through VS Code or wherever it is you're using it, it'll work in the setup that I'm going to show you. So I have this set up for my own business, and I've also been testing out in this workspace here. And Claude Code has kindly given me a full step-by-step breakdown of how to do it, and of course it's going to ensure it works flawlessly. But don't worry, I've tested this all out, so we're going to run through this workbook here, do it together so you can see it live. But there are a few things that we need first, one of those actually being a VPS. And now you can do this on whatever VPS you like, so you can use like Hostinger, Railway, anything like that. I'm going to be using Heroku because it's pretty simple to set up, and I think it's also one of the cheapest out there. So I'm in my Heroku dashboard here, and we're just going to show you the process quickly of setting up a VPS. So you can see this is actually my personal one here that I use pretty much every day. We're just going to hit on new project here, and we're just going to call this something like, you know, YouTube demo. Hit add project, and we're going to come inside here. And now we need to actually create a server, so we're just going to go to servers here. And then all of this stuff, this is basically like choosing where it's hosted, what it runs on, the different parameters of it. We're just going to go with a regular performance one, which should be absolutely fine for what we're trying to do. So we just hit on that. You can see this one costs €10, but of course you can choose a different one if you want. You can also see there's some different options here. We'll be absolutely fine with this first one. If anything, it might even be a little bit overkill, so we're not going to have to worry about it. And then we can choose the location we want this to be hosted. So Falkenstein, uh, Nuremberg are probably going to be the closest ones to me, so we'll just go with this one here. These are in Germany. I'm of course in the UK. And then for the image, we're going to go Ubuntu, and then pretty much everything else you can leave it as it is. So all of this kind of stuff here, you can just scroll past it. And then the name, if we want to name it that, that's completely fine. You can name it something else if you like. So we're just going to hit Create and Buy Now. I already have my card details linked up to this, so that's why I'm not giving any of the card details over. But of course, when you set up Hertz now, you just do that yourself. So give it a couple seconds, and now you can see it has been created. So if we click inside of here, this is pretty much all we need. We don't really need to do anything inside of here. All we need is this IP here, which I'll show you what to do with later. And then the second thing we need to set up is the GitHub repo. So that project on VS Code, I have that linked to this GitHub repo. And if you don't know how to do that, don't worry. Literally just say to Claude Code on any workspace that you're in, link this to GitHub, host this on GitHub, something like that, and it'll do absolutely everything for you. It can do it all through the command line, so you don't even have to go into GitHub. The most you have to do is give it an API key so it can connect up to your GitHub, but you only have to do that one time. And then yeah, you can literally just say host this workspace on GitHub, it'll create a GitHub repo for you like this. And then we're also going to need to have Telegram set up, and I'll show you how to do that a little bit later on, but just remind you're going to need to have it installed and everything like that. Okay, great. Now that we've got all that down, we can begin actually working on this. You can see some of the things that it told us to do here. And like I said, when you download this, you'll get this full workbook here, so you don't have to worry about it. And this is the name of the folder that we're in right now. So it's under Users, Admin, Claude Code, AI Employees Template on my laptop. So the first thing that we need to do is open our terminal. Pretty much all of this is going to be done through our terminal, so let's go ahead and do that. Okay, so we got our terminal here. And first of all, we just have to run SSH root and then the sign and then our VPS IP. And if you don't know what SSH is, it basically just means it's something you can do from the terminal and it basically just means like going into something. So SSH in, basically just going into our VPS here. And then all the commands we do after that will be commands that apply to our VPS. So it needs our VPS IP. So we just come over to here, copy that, and then we just simply paste that in. And it's just saying what we're going into and saying, do we want to continue? We're just going to type yes, hit enter. And it's going to ask us for our password. And when you sign up to Hertz, now you should get something like this which will give you your password. So we're just going to copy that and then paste that in, in the terminal. If you're not used to using it with the password stuff, like when you type stuff in or paste stuff in, it won't show up as you type in or anything like that. So don't be confused, I've just pasted it in here and you can see there's nothing there. But if I hit enter, it's gone through and it's asking me to change my password. So I just pasted in my current password and then new password, let's do something that we will remember. Looks like I got the password wrong, so I'm going to just do that full process again and come back when it's done. Okay, cool, done the new password. Uh, actually got it right this time. You can see now this part changes here, which just means we're working inside of that VPS. So let's go back to Claude Code, and what does it say to do after that? So now we need to add a user onto that VPS that we can actually work from. So we're going to go add user, and then AI just means the name is AI. So we're going to go add user AI, and then we're going to give this a password here. So let's type this in, make sure we don't forget it when we're retyping it again like we did last time. And then full name, let's just call it AI Personal Assistant. And then for everything else, we can just hit enter because it's just going to do the default. It doesn't really matter. Is this information correct? So we're going to hit yes. And then now we've created that new user. So now we need to give that user sudo. So we're just going to paste this command in here, and there's going to be like no response. And as Claude says, expected no response. Which basically means it's worked. And then we're actually switch to that user. So su here, or su, which just means we're going to switch to that user. It's going to turn green. Now we're that AR user that we just made, as you can see here. Okay, now we need to open another terminal window and run this. This just means because it needs to be outside of our VPS. So we'll keep that one running there, open a new one. So we've got a new terminal up here, and then we're just going to copy this. But you can see, uh, we have to put in our VPS IP here. So let's do that really quick. Okay, got it in there. Then it's going to ask for our password. So I'd recommend with the users and the VPS itself, for me, I've just done the same password because then when it asks me for my password and things to do my VPS, I just know which one it is. I don't have to worry about it. But of course, it's completely up to you. Okay, you can tell I'm not my best form today because I got the password wrong again, but then I got it right. And you can see now it's just bootstrapped it, which is what we were looking for. So now we can go back into the SSH terminal, which is that other one, and then we can run this command here. So let's paste that command in, and then it asks for our password again. So let's type in our password, and then it's just going to do a bunch of stuff here, install a bunch of packages, and we're just going to wait for that to run through. If we come back over to Claude Code, this should install Git, tmux, gh, Node v22, bun, and then Claude as well, which is basically everything that we need. Okay, cool. So it's just finished and it's given us some next steps here. We don't have to worry too much about that because everything's already inside of this Claude Code chat. So it said refresh your path so the new commands are findable. So we're just going to run these commands it's given us. Claude version, and we're on 2.1.143. 2.1— yeah, and then 2.1.143, which is perfect. And then now we're going to clone the workspace. So we already have it inside of GitHub. Now we're going to clone it and put the clone version on the VPS. So cool, let's do that. Let's copy that command, paste that in here, and it's now going to clone it. And it did that pretty quickly, so that's now cloned. And then now we're actually going to start Claude up inside of this chat, and we'll have to do the whole thing of like authenticating Claude and stuff. So you can see, open straight away. Let's go. Light mode, and then we're going to authenticate with my subscription. Didn't open the browser for us, but it gave us this link to open, so let's do that. You'll land on a page, it looks something like this. Just hit authorize, and yeah, it should give us a code, as it did. Awesome. So let's go back over and then just paste in that code, and then it should authenticate here. So yeah, authenticated, and then just send us the security stuff. Yes, I trust this folder, and then boom, we're inside of Claude Code now, which is really cool. So now Claude Code is actually installed into that VPS. Awesome. Now we're just going to exit that because we've already set it up, so we don't need to do anything anything inside of there just yet. So let's exit that. We've gone back into the user inside of the VPS, which is good. And then now we need to install the Telegram plugin. So let's go back into Claude. We're just exiting to make sure we would exit back into the user there, which we did. So now we're going back into Claude. Now we're going to actually install this Telegram plugin. So we're just going to run these commands here, and it looks like that was already installed on there. So some of these might already be installed, but we're just going to do them kind of like a safety. So this guide will work for anyone whether it's already installed on your Claude code or not. And then now we're going to install Telegram, so we're going to hit Install for You. Telegram installed. And then I think it's going to ask us, yeah, to reload plugins. So let's just run that quickly. A lot of this is just going to be literally copying in things into this command line here. So you can see now that we reloaded it, we have one plugin, which is of course Telegram. And then now we need to get this bot token from Telegram to paste in here. You can see, paste your bot token. So let's do that. We're going to open Botfather here, and you can see I've already been testing this out. But we're just going to run new bot like this. Cool. What are we going to call it? We're going to say YouTube demo again. And then what's the bot's name? Let's say YT demo, and then a bunch of random letters and numbers because it can't be the same as, uh, what someone else has already done. So of course, for you, you can go back and forth and just make sure you actually get the name you want. But for this, I'm just gonna do a random string of numbers to make sure it actually goes through. Cool. So now we've got this token here, so we're gonna copy that. Well, actually, no, we're not gonna copy that yet. We're gonna copy this, close this one down, And then in here we're going to paste that, but just remove this section here. The cool thing about this is now we're actually talking to Claude Code. We're not talking, um, we're not putting stuff into the terminal. So like if one letter's off or something, obviously in the code you can't have letters off, but if like one letter's off when you're telling it to do something, it doesn't really matter. And then let's open up Botfather again, get our token, close that down, paste that in there. So then now that should link Claude Code with that Telegram bot that we've just made. So it's going to ask us for all these bash commands and things like that because it's not on bypass permissions. I'm going to show you set it up with bypass permissions. But I'm just going to hit accept for all of these and we'll come back when it's set up. Cool, so it now says that it's paired. So now what we need to do is we need to actually message this bot on Telegram. We can just hit it here, message this bot on Telegram. So if we just say like, hey, should come back to us with a pairing code here. Let's see if it does. Okay, it hasn't come back yet, which isn't an issue. We can just go on to the next phase of this, which was exit out of Claude Code, because now they are connected. We just need to actually configure it. So we can exit out of Claude Code, come back into that user in the VPS, and then we're going to start a Teamux, which basically means that now this is always going to be on. So even if we close the terminal down, you can see, uh, you get this green line at the bottom, which just means that it's now in the right mode. So now we relaunch it with dangerously skip permissions. So we relaunch Claude with dangerously skip permissions, which just means when you're talking to it through Telegram, you're not going to constantly having to like allow it to do bash commands and things. It can just kind of crack on. So let's hit yes, I accept. And now we're going to try pair Telegram again. And sometimes this can be a bit of back and forth here. So we're going to try again to say hi to this. Okay, yeah, cool. So it instantly comes back with this pairing code, which is exactly what we wanted the first time. So that's cool. So we're just going to paste that directly into Claude Code here, and I already know what to do because we've run the Telegram command. So now I'm going to pair them together. Then we should be able to just talk to that bot on Telegram, and it will actually come through in this Claude Code terminal, which is quite cool. So we can see our messages from Telegram come through in the Claude Code terminal. Of course, we don't want the terminal open the whole time, so we can just shut it down, but it's just cool to see it and kind of for testing. Okay, cool. And then it said, uh, paired. Say hi to Claude inside of Telegram. So let's move these so you can see them. Let's just do what it says. Let's say hi. So we said hi to it. Then yeah, you can see inside of the terminal here, Telegram, and then this would be our user here. Hi. So obviously because we said hi and Claude Code is like built into Fink and stuff, it takes a while to reply, but it's like just as quick as using Claude Code. It's literally the exact same thing as using Claude Code, but it's just through Telegram and it's 24/7. So we just said, am I safe to terminate this terminal? Will Telegram still work? So I'm pretty sure it will, but just to make sure, because we have Claude Code right in front of us, we can just ask it if there's anything more that we need to do. And as you can see, it says yes, safe, I'm running inside of tmux. And you can see because we have that green line at the bottom. Awesome. So we can just close this down, terminate it, and then come back over to Telegram and say something like, what context files do you have access to? We know that it's seen it because it's typing up here, which is a good indicator. It might not come back instantly, but we know that it's seen it at least, and it's working on it because it says it's typing up there. So we just give it a sec. Should be a pretty simple query. So yeah, awesome 7 files in the context, and they're all the ones that I showed you at the beginning of the video. And then I now have this on my phone, so I can do it literally from anywhere just with my phone. So I can be on the other side of the world, it doesn't matter as long as Hertzner servers are fine, which they always are. This is literally their job. This is how our whole business is, to run these VPSs. So I don't need my laptop to run Claude code anymore. I can literally just send a message to it on Telegram, does everything for me. So it's actually very similar to something like Hermes Agent or OpenClaw if you know anything about them. But of course, this is custom made by us, so we have full control over it. We can see the GitHub repo, we know exactly where it's hosted, and we can do anything we want with it. So we can build apps, we can create automations, we can get it to scrape things. Anything that you would do with Claude Code inside of VS Code, you can now do on your phone through Telegram from absolutely anywhere in the world. Of course, a lot of the time I'm using it through my laptop when I'm at my desk, but if I'm out and about, I can just pick it up with Telegram, get it to do anything, can email people for me. In this video, I didn't show you how to set up all the MCPs, but it's the exact same as setting up the MCPs inside of your VS Code Claude Code setup. It's the exact same process. You would have just done it through that terminal that I showed you a minute ago that I just shut down. So that's it for this video, guys. I hope you enjoyed it and I hope you learned something because I use this literally all the time. It's a game changer for me. And like I said, if you want to grab the free template and just get started with this straight away so you can do it with your existing workspace inside of Claude Code and just use that workbook, go ahead and click the link in the description of this video. You can have it for absolutely free.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










