📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Claude Code на сервере: личный AI-инженер сделает всё за вас – только попроси

Игорь Зуевич21:43

Transcription

Claude Code on your own server, for me, it's an engineer who sits inside my own server and solves, based on a text request, that is, performs, based on a text request, the tasks that I need to perform specifically on this server, for example, deploying a new VPN when something has stopped working, for example, deploying n8n, deploying some databases, for example, PostgreSQL, or even better, there, Supabase databases, that is, Claude Code on our own server can do what we usually do manually. I am not a programmer, I just hate this terminal, I hate this terminal where you can't move around with a mouse, where you have to enter commands by text request, and when I need to interact with this terminal, what do I do? That is, I take it like this, photograph it, send this photograph to ChatGPT, to Claude, to Gemini, and say, "Here, I entered such a command, here is such a response, what should I do next to solve such a task?" And this whole process took time. Now that Claude Code is on our own server, we simply write the task to it right here in the terminal, write, uh, what it needs to do, and it does it literally in a few minutes. We don't need to touch anything, for example, deploy a Telegram bot that will have no restrictions, that will be located inside our server, not through BotFather, through the usual standard Telegram where there are restrictions on file sizes, where there are a large number of restrictions, or n8n. I need to create a new, fresh n8n. What do I do? I either manually start entering commands to deploy n8n. No, I don't know how to do that. I'd rather ask Claude Code in a text request to deploy n8n for me on my own server, or any other application, or any other program. And in this video, I will show you how, with just a few prompts, we can deploy Claude Code on our own server, and with a subscription, Claude Code, without paying for a separate app. Let's go. Okay, good, look, so I've prepared a few files. The first file is the installation of Claude Code, it's just launching Claude Code on your own server. And the second file is the use cases of Claude Code on your own server. Here are detailed prompts for Claude Code to correctly perform the task we need, for example, deploying n8n, for example, installing your own VPN, for example, creating a Telegram bot that has no restrictions, for example, creating your own, how to say it correctly, system administrator, probably, who will sit on our server. If any problems arise, he will be able to solve this task accordingly, or a content factory that we can launch on our own server using Claude Code, well, or do a full security audit and make our server secure, where there is no need to involve any third-party engineer. Claude Code will do everything necessary itself and give us instructions on how to use it. If we talk about the differences, for example, we already have the Claude Code application, where Claude Code is available to us, or the Visual Studio Code service where we installed a special extension that allowed us to work with Claude Code. Here, we do all the work locally, and then we need to upload all these files directly to our server. When Claude Code lives on our server, inside, it can do all this right inside, and we won't even need to upload anything there later. It will upload everything itself, configure everything itself, connect the ports itself, connect, make connections, for example, in the same deployment of n8n with some databases like PostgreSQL. Therefore, Claude Code is an engineer who sits inside our database, who sits inside our server, and solves those tasks that we either don't want to or can't solve. So, how to install it on your own server? First, we want to buy our own server or rent our own server. I will show, for example, DigitalOcean for one simple reason. DigitalOcean allows for billing and testing, trying without paying a lot of money for it. For example, they have daily billing, I choose it specifically, and because of this, after deploying the server, demonstrating how it's done, I will simply delete it, and that's it, and there will be no problems. Plus, for this, I will pay fifty cents or ten cents or one dollar, but not much. When we choose some other platforms, for example, I have a platform where I have been using my own servers lately, for example, Hostinger, it's called a platform. It's cool because it's practically unknown, its rates are slightly lower, but in it, if in DigitalOcean when we deploy the same VPN, all IP addresses are simply automatically blocked or already blocked, or everyone sees them as blocked, then on the same Hostinger server when we buy our server, the IP addresses are completely clean, cost less, and there is no "giving away" because not everyone there deploys their own server, everyone uses the popular, trendy DigitalOcean. And you need to look for unpopular, non-trendy ones to use them correctly. So, okay, DigitalOcean, I will demonstrate. So, all we need to do is rent a server. Server, so we choose a Droplet, choose San Francisco, let it be Ubuntu, this version is quite enough. So, I will immediately choose a more expensive tariff, anyway, I will delete it and pay literally a few cents for its use. You can choose the cheapest tariff there. Their tariffs start from four dollars, which is quite convenient, four dollars twenty-four dollars, and connection using SSH or password. Well, let's say most people probably won't bother with creating their SSH key, although it's a more secure way to log into your server. But let's go by password. So, as a password, I will enter the password here. I will copy this password now so that it stays somewhere. The password I came up with is the simplest. Okay, so, the password matched, that's the main thing. Next, I need to choose monitoring. Okay, one Droplet, and I'll name it something, well, I don't know. Let's use the simplest tasks. So, in which project will it be? Okay, let it be in this project, it doesn't matter now. We create a project, we create hosting, it's starting now. I will need to log into it next. For this, I will use the Termius application. I've shown this application before, and here I just create a new host. I need to enter the IP address that I will get now, and I need to enter, so, the username, port 22, 22, the username here will be the standard root, and the password, this one that we just created. So, let's wait for it to turn on and get the IP address. So, we've already got the IP address. Click copy, and in Termius, add this IP address here. So, this is our test query, right? Okay, it seems like everything is fine. Click connect. Yes, we'll connect. Yes, the connection was successful, quickly. We have our own server. Now we need to install our Claude Code on it. I will use the instructions. The instructions are in the first pinned message. So, the instructions for installing Claude Code. This is the instruction. And also, the instructions for prompts are also in the first pinned message. There is a more convenient format in Google Docs. Download, look at how you want to use it, how you want to use it, or you can download the instructions, or download the command for deployment directly on the Claude Claude project website. Here is the command, you just need to copy it. Then, go to Termius, enter this command, press Enter, and that's it. Now we will have the installation of our Claude Code on our own server. After that, we can ask it to update the system, do something else, or install some Docker, but that will be later. Look, so, the installation is complete. You can now use Claude. After that, we should exit and reconnect. Okay, all good. Let's move on to our instructions, and here is the second page. What needs to be done is to enter this command to check if Claude is installed. Enter this Claude version, see what version it is. So, I'm pressing something wrong. Yes, Claude version is this and this. And the next step is to launch Claude itself. So, look, we launched Claude itself. And now we need to go through the authorization process for Claude. So, let's see what it offers us. Hello world, hello Claude. Okay, so we need to choose a theme, that is, a dark theme, a light theme. I'm just pressing keys and choosing a theme for our code. Well, let it be a dark theme, it suits us. And here, look at the advantage. We can now link Claude Code to our main Claude profile and use the limits that are given on certain tariffs. For example, I have a bonus account with about fifty dollars for usage, I haven't even managed to spend it yet, although I have the minimum tariff in Claude. And Claude periodically gives various bonuses when new models come out. I talked about this in a video when I demonstrated the capabilities of working with Claude. So, I will link it through my main subscription. I choose this. I can choose through API, and I can choose through some third-party platforms. Honestly, I don't even know what that is. So, I will use it through the main subscription. And I need to open this link in the browser. So, I will copy this link now, the entire link. And I open this link in the browser. At first, it didn't understand what it wanted from me. I say, "Yes, authorize." I authorize. I copy this, and I need to paste it here, here, here. I paste it here, press Enter. Login success. So, the connection was successful. Press Enter. Next, so, it tells me that everything is good. Press Enter to continue. And then it offers me, how to say it correctly, it asks if I can work within this folder. Look, as a demonstration, I showed you how to install Claude Code without creating any additional folders, without creating any additional extensions. I will just put Claude Code in my main folder, and it will work there itself. This is for full access to Claude Code. Also, I could have created a separate folder at the very beginning and placed Claude Code there to work, but I want it to fully administer this resource. This VPS will be fully managed by Claude Code. Therefore, I tell it, yes, I trust this folder, you can use it accordingly. That is, essentially, it is installed, and now we can interact with it right here, that is, write any tasks to it. And for this, for example, we will go to the second file, which is also in Telegram, the file called "Prompts for Claude Code." So, from here, we can already take a real prompt for use on our server. But first, let me enter this prompt into it so that it simply analyzes my server. This prompt, I will probably also attach separately. The prompt says that it should simply perform diagnostics and analysis of my server. Look, so, in the process, we can see how Claude Code thinks. It asks for our permission. I can always perform these tasks in this folder, this second option, or I can use this task only now. Here, we start giving it some permissions. That is, you can always act if there are similar tasks, you can always act, or no, you cannot act, or you can act only now. I will choose the option that you can act only now, so that it periodically asks me for permission. Can I act? So, uh, do you want to continue? Yes, okay. And here, uh, now, okay, when it has some commands, it asks us for permission. I can enter this command here to see how it works. We tell it, okay, yes, you can do it. And here I can enter this command to see how it works. I say, yes, okay, you can enter it here. How to see how it works? Next, it asks, I can perform an analysis here, and it shows how it performs the analysis. It shows, I don't know if you saw it, the number of tokens it uses for this analysis, and then sends us detailed instructions on what is happening on our server. Well, okay, for many, this might be, and then, in this way, we communicate with it. It gave us detailed instructions on what it can do, what it sees on our server, how to work with it accordingly. That is, such a, uh, security risk, that is, such a security risk, so much memory on your service, so many actions, these ports are open, these actions have been taken. But this is good. Now we can give it some real tasks to perform, for example, the task of deploying n8n. But first, I would recommend that you insert a prompt into it that will tell it how it should act within our server. This prompt, I recommend, I didn't make it for myself because it's individual for each of you. We have a template of this prompt, also in Telegram, here is Claude MD, this is the prompt of how Claude should act in one place or another, in this case, this Claude will act within our server. Here we specify all permissions. How to create this file? I recommend going to ChatGPT or Claude, uploading this file, and saying, "I have deployed code on my own server for Claude Code, for my own server, to solve these and these tasks. Help me adjust the rules, help me set up the instructions for solving tasks. Ask me questions, I will answer you for what tasks I will use Claude Code." And thus, you create Claude within Claude Code on your own server, uh, roughly speaking, separate instructions for it on how it should act here, grant permissions, not grant permissions. Next, why can all this be done right here, right on your own server? But I recommend switching to a separate, somewhere, ChatGPT, Claude, because I use them, for example, as a draft. And on my own server, to save those very tokens, I use the final versions. That is, I give the file in its final form and clearly understand that this file will work. This file is valid on this particular server because here, there is less hallucination. It gets, in simple words. Well, okay, let's do something interesting. Let's deploy n8n. That is, I copy this command for n8n. I can also copy the command directly from our instructions. Here it is more convenient for me at the moment, in the form of, and I will just copy this, uh, command. So, how does this command look? I have instructions for each command. Deploy n8n, n8n in production mode. Here is a full translation of how to deploy n8n. Now it will ask us, ask for a request, that is, do you have a domain name, or will we use an IP address, or something else? But at the moment, I don't have a domain name for this server, so I tell it, we will use an IP address. To use an IP address, you need to create an SSH key. To use an SSH key, you need to specify it for login. That is, you know, this is already starting to be a rather large amount of work. Let's say, yes, you can run commands. It is now performing commands itself. We can see the number of tokens it consumes. Let's see how it thinks. Look, so, it made itself a complete instruction first. That is, the same thing that we used in Visual Studio Code, the same thing that we use in the Claude application, Claude Code. It wrote itself an instruction on what it needs to do. It needs to install Docker or Docker Compose. That is, it logged into our server. This server is empty, there is no Docker. And it says, "Need to install Docker." Yes, I say, "Okay, let's install it." And it is now installing Docker and Docker Compose. That is, it fully understands what we need, not how we do it. That is, we log into, say, ChatGPT, and they tell us, "You need to install Docker, enter these commands," and we enter these commands. Next, we think, "Now we need to install n8n." We install n8n. How will we log in there? We need to attach a domain name. We attach a domain name. Here, it does everything itself, without us, without our participation. And I like this. Look, the number of tokens it spent. Everything, it installed Docker and Docker Compose. We can even see the process of its installation. It moves to the next step. It installed, oh, it creates the n8n project structure. I say, "Okay, let's create it." Next, it generates an SSL certificate for login. And it would be desirable, of course, to attach your domain name. And for it to launch all this. Then we click, confirm some actions, or give it full access to all actions immediately, and it performs these actions accordingly. That is, look, here are all the login details that it provides. That is, it does the same thing that, say, Royalway does. The only thing is, it would have been better to copy these login details. And it created a file with these login details. Okay, well, this is all. The entire history can be viewed. All history is saved. The files that I posted here. There is a small number of commands that you can use. A large number of prompts that you can use. If you need something of your own to add, to do, you can simply write. My commands are more complex, so that it clearly understands what needs to be done. You can simply write to it, "Deploy n8n for me," and it will start deploying n8n. And look, so, it gave us complete instructions on how we can use it, how we can log into our own server. So, most likely, I won't be able to log in now because I haven't installed an SSL certificate. But let's go to additional settings anyway. Here, it asks for my username. So, username admin, and password, this password. This password, username admin. I click the login button, and we get into the n8n interface. For registration, enter your email, name, password, and name, password, and get, accordingly, the license key from n8n that is given for free upon registration. That is, look, it installed n8n for us. It gave complete instructions on how to work with it. Of course, it would be better if we sent it. It also installed a PostgreSQL database. If we had sent it, the domain name, and it had also attached it to our server, this domain name. That is, we get a full administrator who will work on our server and fulfill our requests that we want to give him with a simple request. Here, guys, I hope this video was useful to you. Be sure to download all the handouts in the first pinned message under this video. Give me a like, write something in the comments. It really motivates me when you give some feedback. This was Igor Zuyevich. Bye.