Deploy a Trading Bot to Windows VPS
Deploy your Telegram-MT5 signal copier bot to a cloud VPS for 24/7 uptime.
Introduction
30 Second Summary
Your trading bot only works when your laptop is open. Close the lid, lose internet, or restart for an update, and your bot goes silent. Missed signals mean missed trades.
In this project, you will deploy your existing Telegram-MT5 Signal Copier Bot to a remote Windows VPS so it runs 24/7 without your laptop needing to stay on.
What You'll Build
A cloud-hosted Windows server running your signal copier bot around the clock, copying Telegram trading signals to MetaTrader 5 whether your laptop is on or off.
By the end of this project, you'll have:
- Your bot copying Telegram signals to MT5 around the clock on a remote server you access from anywhere via Remote Desktop.
- A single-command deployment workflow using Git so updating your bot on the server takes seconds.
- Automatic restart on reboot via Windows Task Scheduler and a locked-down firewall that makes your server invisible to everyone except you.
- Secret Mission: A watchdog script that detects when your bot crashes and brings it back to life automatically.
Are there any prerequisites?
This project assumes you already have a working Telegram-MT5 Signal Copier Bot running locally on Windows (bot.py, parser.py, trader.py, config.py, requirements.txt). You also need a GitHub account and basic Git experience.
Before We Start
Before we dive in, let's lock in what you're about to deploy and why it needs to live on a remote server instead of your laptop.
Provision Your Windows VPS on Kamatera
Right now your bot only runs when your laptop is on and connected to the internet. Close the lid, lose Wi-Fi, or restart for an update, and the bot dies. You need a machine that stays powered on 24/7.
Kamatera offers a 30-day free trial worth up to $100 in server time. That gives you a full Windows Server 2022 VPS at zero cost for a month. In this step, you will create your account, configure the server, and get it running.
In this step, get ready to:
- Create a Kamatera account and activate the 30-day free trial.
- Configure and deploy a Windows Server 2022 VPS with the right specs for MT5.
- Note the server's public IP address for connecting later.
Create a Kamatera account and start the free trial
Kamatera is a cloud hosting provider that offers Windows VPS instances with no premium charge for the Windows license. Their 30-day free trial lets you run a server without paying anything upfront.
- Open your browser and navigate to https://www.kamatera.com.
- Click Start Free Trial on the homepage.
- Enter your email address and create a password for your Kamatera account.
- Provide a credit card when prompted.
Will I be charged?
No. Your card is required to activate the trial but will not be charged during the 30-day period as long as you stay within the $100 limit and cancel before the trial ends. You will set a reminder to clean up in the Before You Go section at the end of this project.
- Once your account is active, you will land on the Kamatera dashboard.
Configure and deploy the Windows VPS
Now you will create the actual server. The configuration needs enough RAM to run MetaTrader 5 and your Python bot simultaneously.
- In the left-side navigation panel, expand My Cloud and click Servers.
- Click Create New Server.
- Under Server Type, select Cloud Server (Type A - Availability).
- Under Zone, choose the datacenter location closest to your MT5 broker's server for the lowest latency.
- Under Choose Version, select Windows Server 2022 Datacenter 64-bit as the operating system.
- Set the CPU to 2 Availability Cores.
- Set RAM to 4 GB.
- Set storage to 30 GB NVMe SSD.
- Set traffic to 5 TB.
Why these specs?
MetaTrader 5 alone uses roughly 300-500 MB of RAM with a few charts open. Adding Python and your bot brings total usage close to 2 GB. The 4 GB allocation gives comfortable headroom so nothing crashes under load.
Your bot uses almost no network bandwidth (just Telegram API calls and MT5 order messages), so 5 TB of traffic will never be reached.
- Leave Daily Backup disabled (not needed for this project).
- Leave Management Services disabled.
- Under Networking, keep the default (WAN with a public IP).
- In the Password field, enter a strong Administrator password. Use at least 16 characters with a mix of uppercase, lowercase, numbers, and symbols.
- Save this password somewhere secure (a password manager is ideal). You will need it every time you connect to the server.
- Give your server a name (for example, signal-copier-bot).
- Select Monthly billing.
- Click Create Server.
Server creation takes a few minutes
Kamatera will begin provisioning your server. You can monitor progress in the Tasks Queue window. Wait approximately 5-10 minutes for Windows Server 2022 to finish installing.
Note your server's public IP address
Once provisioning completes, you need the server's public IP address. This is the address you will use to connect remotely in the next step.
- In the left panel, click My Cloud then Servers.
- Confirm your server's status shows Running.
- Click Open next to your server's name.
- In the server Overview panel, find the public IP address. Copy it and save it alongside your password.
Before you move on, what do you expect to see in the Kamatera dashboard right now?
You should see your server listed with a status of Running and a public IP address displayed in the overview. This confirms the VPS is live and ready for you to connect.
Server stuck in provisioning?
If the status still shows provisioning after 15 minutes, check the Tasks Queue for error messages. Common causes are billing issues (card declined) or a temporary capacity problem at the selected datacenter.
Try selecting a different datacenter zone and creating the server again. If billing failed, verify your credit card details under your account profile in the top-right corner of the dashboard.
My Kamatera server is stuck provisioning. What should I check?
Your Windows VPS is live. Next up, you will connect to it via Remote Desktop and install Python and MetaTrader 5 so your bot has everything it needs to run.
Connect via RDP and Install Your Environment
Your VPS is running in the cloud, but right now it is just a bare Windows server with nothing installed. To run your signal copier bot, you need the same tools on the VPS that you already have locally: Python and MetaTrader 5.
Remote Desktop Protocol (RDP) gives you a full graphical Windows session over the internet. You will connect to the VPS desktop, then install Python and MT5 exactly as you did on your local machine.
In this step, get ready to:
- Connect to your VPS using Remote Desktop Connection.
- Install Python 3.13.7 and verify it is on the system PATH.
- Install and configure MetaTrader 5 terminal on the VPS.
Connect to the VPS using Remote Desktop Connection
Remote Desktop Connection is a built-in Windows app that lets you control a remote computer as if you were sitting in front of it. You will use the VPS public IP address you noted from the Kamatera dashboard.
- On your local Windows machine, press Win + R to open the Run dialog.
- Type mstsc and press Enter to launch Remote Desktop Connection.
- In the Computer field, enter your VPS public IP address.
- Click Connect.
- Enter Administrator as the username.
- Enter the password you set during server creation.
- A certificate warning will appear because the VPS uses a self-signed certificate. Click Yes to accept and connect.
You should now see the Windows Server 2022 desktop on your screen. It looks like a standard Windows desktop, controlled through your RDP window.
What is RDP?
Remote Desktop Protocol transmits your keyboard, mouse, and display between your local machine and the remote server over the internet. On Windows Server, disconnecting from RDP does NOT log you out. Your session stays alive in the background, and any processes running in it continue without interruption.
Can't connect to the VPS?
Double-check you entered the correct public IP address from the Kamatera dashboard. Make sure the server status shows Running.
If you see a credentials error, confirm the username is Administrator (capital A) and the password matches exactly what you set during provisioning.
Why can't I connect to my VPS via RDP?
Install Python 3.13 on the VPS
Your bot requires Python 3.13.7 to run. The VPS has no Python installed yet, so you will download and install it from the official website.
- On the VPS desktop, open Microsoft Edge from the taskbar.
- Navigate to https://www.python.org/downloads/windows/.
- Download the Python 3.13.7 installer (Windows installer 64-bit).
- Run the installer once the download completes.
- On the first page of the installer, check the Add python.exe to PATH checkbox at the bottom. This is critical.
- Click Install Now.
- Wait for the installation to complete, then close the installer.
Why is Add python.exe to PATH important?
Without this option, Windows does not know where to find python.exe when you type python in Command Prompt. Checking this box tells the installer to register Python's location in the system PATH so you can run it from any directory.
Before you verify the install, predict what you expect to see when you type python --version in a fresh Command Prompt.
- Open a new Command Prompt on the VPS (press Win + R, type cmd, press Enter).
- Verify the installation by running:
python --version
✔️ I see Python 3.13.7
Python is installed and on your PATH. You are ready to move on to MetaTrader 5.
ⓧ 'python' is not recognized
This means the PATH was not updated. The most common cause is forgetting to check the Add python.exe to PATH checkbox during installation.
- Re-run the Python installer you downloaded.
- Click Modify.
- Click Next through the features screen without changing anything.
- On the Advanced Options screen, check Add Python to environment variables.
- Click Install.
- Close and reopen Command Prompt, then run python --version again.
Install MetaTrader 5 terminal
Your bot communicates with MetaTrader 5 through an IPC connection. The MT5 terminal must be installed and running on the same machine as your bot script.
- In Edge on the VPS, navigate to your broker's website and download the MetaTrader 5 terminal installer. If your broker does not offer a direct download, use https://www.metatrader5.com/en/download.
- Run the MT5 installer and complete the setup wizard with default settings.
- Launch MetaTrader 5 once the installation finishes.
- Log in to your trading account using your broker credentials.
Now enable algorithmic trading so your bot can place orders programmatically.
- In MT5, click Tools in the top menu bar.
- Select Options.
- Click the Expert Advisors tab.
- Check Allow algorithmic trading.
- Click OK.
Why does MT5 need to stay open?
The Python MetaTrader5 library uses IPC (inter-process communication) to talk to the MT5 terminal process. If the terminal is closed, mt5.initialize() will return False and your bot cannot place trades.
Confirm the connection status. Look at the bottom-right corner of the MetaTrader 5 window. You should see a green bar indicating a live connection to your broker's server.
MT5 shows a red or grey connection status?
Make sure you entered the correct broker login, password, and server name. The server field must match what your broker provided exactly.
If the connection times out, try clicking File then Login to Trade Account and re-enter your credentials.
Help me fix my MT5 connection on the VPS.
Your remote environment now mirrors your local setup. Python is ready and MetaTrader 5 is live. Next up, you will deploy your bot code from GitHub so it can run on this VPS.
Deploy Your Bot Code via GitHub
Your bot works on the VPS when you run it manually. But right now, the code only lives on your local machine. You need a clean way to get it onto the server.
Dragging files through the RDP window is fragile and impossible to repeat reliably. Git solves this by letting you push your project to GitHub and clone it on the VPS. Later, updating your bot is a single git pull command.
In this step, get ready to:
- Push your local bot project to a private GitHub repository.
- Clone the repository onto the VPS.
- Install Python dependencies and confirm the bot runs on the remote server.
Push your local project to a private GitHub repository
Switch back to your local Windows machine for this substep. You will push your existing bot code to GitHub so you can pull it down on the VPS.
- Open your browser, go to https://github.com/new, and sign in to your GitHub account.
- In the Repository name field, enter signal-copier-bot.
- Set the visibility to Private.
- Leave all other options at their defaults (no README, no .gitignore).
- Click Create repository.
Your repo must be Private
Your config.py contains trading account credentials and Telegram API keys. A public repository would expose these to anyone on the internet.
- Open Command Prompt on your local machine and navigate to your bot project folder by running:
cd [[BOT_PROJECT_PATH="C:\\path\\to\\your\\bot\\project"]]
- Initialize a Git repository and push your code to GitHub by running these commands:
git init
git add .
git commit -m "Initial commit - signal copier bot"
git branch -M main
git remote add origin https://github.com/[[GITHUB_USERNAME="your-github-username"]]/signal-copier-bot.git
git push -u origin main
What do these commands do?
- git init creates a new Git repository in your project folder.
- git add . stages all your project files (bot.py, parser.py, trader.py, config.py, requirements.txt) for commit.
- git push -u origin main uploads everything to your private GitHub repository.
- If GitHub prompts you for authentication, enter your GitHub username and a Personal Access Token as your password.
- Open your repository page at https://github.com/YOUR_USERNAME/signal-copier-bot in your browser.
- Confirm you see bot.py, parser.py, trader.py, config.py, and requirements.txt listed in the file view.
Push failed or permission denied?
- Make sure the repository name in your git remote add origin command matches exactly what you created on GitHub (signal-copier-bot).
- GitHub no longer accepts account passwords for Git operations. You need a Personal Access Token. Generate one at Settings > Developer settings > Personal access tokens > Tokens (classic) and use it as your password.
How do I fix a Git push authentication error with GitHub?
Clone the repository on the VPS
Now switch back to your VPS Remote Desktop session. Before you can clone, you need Git installed on the server. Windows Server 2022 does not include Git by default.
- On the VPS, open Microsoft Edge and navigate to https://git-scm.com/download/win.
- Download the Git for Windows x64 Setup standalone installer.
- Run the installer and accept all default options by clicking Next through each screen, then click Install.
- Once installation completes, close and reopen Command Prompt so it picks up the new PATH entries.
- Verify Git is installed by running:
git --version
You should see a version number like git version 2.55.0.windows.1 or similar.
Command not found after installing Git?
- You must close and reopen Command Prompt after installation. The old session does not know about the new PATH entry.
- If it still does not work, open a new Command Prompt and try again. The installer adds Git to the system PATH by default.
Why is git not found in my VPS Command Prompt after installation?
- Navigate to the Desktop and clone your repository by running these commands:
cd C:\Users\Administrator\Desktop
git clone https://github.com/[[GITHUB_USERNAME="your-github-username"]]/signal-copier-bot.git
cd signal-copier-bot
GitHub will ask for authentication
When prompted for your username, enter your GitHub username. For the password, paste a Personal Access Token (not your GitHub account password). If you already generated one in the previous substep, reuse it here.
To create a token, go to GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic) and generate one with the repo scope.
- Confirm the files are in place by running:
dir
You should see bot.py, parser.py, trader.py, config.py, and requirements.txt listed in the output.
Clone failed or repository not found?
- Double-check that you typed your GitHub username correctly in the URL.
- Make sure your Personal Access Token has the repo scope enabled. Without it, GitHub blocks access to private repositories.
Why is my git clone failing with a 'repository not found' error?
Install Python dependencies and run a test
Your code is on the VPS, but the Python packages it depends on are not yet installed. Time to install them and confirm everything connects.
- Install all required Python packages by running:
pip install -r requirements.txt
You should see packages downloading and installing. Wait for the process to finish with no errors.
Seeing installation errors?
- Make sure you are inside the signal-copier-bot folder. Run cd C:\Users\Administrator\Desktop\signal-copier-bot if needed.
- If a specific package fails, check that Python 3.13.7 is still on PATH by running python --version.
Why is pip install failing on my Windows VPS?
Before you run the bot, think about what you expect to see. The bot needs to connect to two external services: Telegram and MetaTrader 5. Do you think both connections will succeed on this VPS?
- Start the bot by running:
python bot.py
You should see connection success messages in the console output confirming the bot connected to both Telegram and MetaTrader 5. The bot is now live and listening for signals.
- Press Ctrl+C to stop the bot after confirming it works.
Why stop the bot now?
If you close the Command Prompt window or disconnect from RDP, this process will die. In the next step, you will set up Windows Task Scheduler to keep the bot running permanently in the background.
Bot fails to connect to MT5?
- Make sure MetaTrader 5 is still open and logged in on the VPS. The MT5 terminal must be running for the Python library to communicate with it.
- Check that Allow algorithmic trading is enabled in MT5 under Tools > Options > Expert Advisors.
- Verify the broker credentials in your config.py match the account you logged into on the VPS MT5 terminal.
Why is my bot failing to connect to MetaTrader 5 on the VPS?
Your bot code is deployed and verified on the VPS. Next up, you will configure Windows Task Scheduler so the bot keeps running 24/7, even after you disconnect from RDP or the server reboots.
Configure 24/7 Background Execution with Task Scheduler
Your bot connects to both Telegram and MT5 on the VPS. You confirmed that with the manual test run in the last step.
There is a critical gap though. If you close your RDP session or the VPS reboots, the Command Prompt window disappears and your bot dies with it. Windows Task Scheduler solves this by launching your bot automatically on startup and keeping it running in the background, even when you disconnect.
In this step, get ready to:
- Create a launcher batch file that starts your bot.
- Schedule the bot to start automatically on every system startup.
- Test that the bot survives an RDP disconnection.
Create a launcher batch file
Task Scheduler needs a single file to execute when it triggers. A batch file wraps your startup commands into one neat package that Task Scheduler can point to.
- On the VPS, press the Windows key to open the Start menu.
- Type Notepad and press Enter to open it.
- Paste the following code into the empty Notepad window:
@echo off
cd /d C:\Users\Administrator\Desktop\signal-copier-bot
python bot.py
What does this batch file do?
- `@echo off` hides the command text from printing in the console window, keeping things clean.
- `cd /d` changes directory to your project folder. The `/d` flag also switches drives if needed.
- `python bot.py` launches your signal copier bot.
- In Notepad, click File, then Save As.
- Navigate to C:\Users\Administrator\Desktop\signal-copier-bot.
- In the Save as type dropdown, select All Files (*.*).
- In the File name field, type start_bot.bat and click Save.
- Confirm the file was saved correctly by running this in Command Prompt:
dir C:\Users\Administrator\Desktop\signal-copier-bot\start_bot.bat
You should see start_bot.bat listed with a file size greater than 0 bytes.
Don't see start_bot.bat?
- If you see start_bot.bat.txt instead, you forgot to change the Save as type to All Files (*.*). Delete the incorrect file and save again with the right file type.
- If the file is not found at all, double-check that you navigated to the signal-copier-bot folder before saving.
Still stuck? Help me fix my start_bot.bat file on the VPS
✔️ Awesome, I've got everything!
Great. Double check you have saved start_bot.bat and then close Notepad.
ⓧ I'd like to double check the full code
@echo off
cd /d C:\Users\Administrator\Desktop\signal-copier-bot
python bot.py
Create a scheduled task that runs on system startup
Task Scheduler can trigger tasks on various schedules. The ONSTART trigger fires every time the VPS boots up, which means your bot will restart itself automatically after power cycles and maintenance reboots.
- Create the scheduled task by running this command in Command Prompt:
schtasks /create /tn "SignalCopierBot" /tr "C:\Users\Administrator\Desktop\signal-copier-bot\start_bot.bat" /sc ONSTART /ru Administrator /rp "YOUR_ADMIN_PASSWORD" /rl HIGHEST /f
- Replace YOUR_ADMIN_PASSWORD with the Administrator password you set when creating the VPS.
What do these flags mean?
- `/tn "SignalCopierBot"` sets the task name so you can reference it later.
- `/tr` points to the batch file that Task Scheduler will execute.
- `/sc ONSTART` triggers the task every time the system starts up.
- `/ru Administrator /rp` runs the task under the Administrator account with the specified password.
- `/rl HIGHEST` gives the task elevated privileges so it can interact with MT5.
- `/f` forces creation without a confirmation prompt.
You should see a success message confirming the task was created.
Seeing an access denied error?
- Make sure you are running Command Prompt as Administrator. Right-click the Command Prompt icon and select Run as administrator.
- Check that your password is correct. If it contains special characters, wrap it in double quotes exactly as shown.
Still stuck? Help me fix my schtasks command on Windows Server
Test the scheduled task and confirm it survives disconnection
The task is configured to run on startup, but you should not wait for a reboot to find out it works. You can trigger it manually right now to confirm everything is wired up correctly.
- Run the task manually by entering this command:
schtasks /run /tn "SignalCopierBot"
- Open Task Manager by pressing Ctrl+Shift+Esc.
- Click the Details tab.
- Look for python.exe in the list of running processes.
You should see python.exe listed. This confirms Task Scheduler launched your bot successfully.
Now for the real test. Before you disconnect, predict what will happen to python.exe when you close the RDP window. Will it survive or die?
- Close your Remote Desktop Connection window (just close the window, do not sign out).
- Wait 60 seconds.
- Reconnect to the VPS using the same RDP steps from Step 2 (press Win + R, type mstsc, enter your VPS IP, and log in).
- Open Task Manager again with Ctrl+Shift+Esc and check the Details tab.
You should see python.exe still running. On Windows Server, disconnecting RDP does not log out your session. The bot keeps running in the background the entire time.
Why does this work on Windows Server but not consumer Windows?
Windows Server keeps disconnected RDP sessions alive indefinitely by default. Processes launched in those sessions continue running. Consumer editions of Windows often terminate sessions when the remote client disconnects, which is why your local machine could not keep the bot running reliably.
Don't see python.exe after reconnecting?
- Make sure you disconnected (closed the RDP window) rather than signing out. Signing out terminates all processes in the session.
- If the bot crashed for a different reason (network error, MT5 disconnect), check the Command Prompt output for error messages. The scheduled task will restart it on next reboot, but you can also run schtasks /run /tn "SignalCopierBot" again to relaunch it now.
Still stuck? Help me figure out why my bot process dies after RDP disconnect
Your bot now runs around the clock on the VPS, surviving both disconnections and reboots. Next up, you will lock down your server so only you can access it.
Harden Your VPS with Firewall Rules
Your VPS has a public IP address that the entire internet can see. Without firewall rules, automated bots will attempt to brute-force your Administrator password on port 3389 within hours of the server going online.
Restricting RDP access to your home IP address makes the server invisible to everyone else. In this step, you will create two Windows Firewall rules that allow only you to connect.
In this step, get ready to:
- Find your home public IPv4 address.
- Create firewall rules that restrict RDP to your IP only.
- Verify the rules by disconnecting and reconnecting via RDP.
Find your home IP address
You need your public IPv4 address so the firewall knows which connections to permit. This step happens on your local machine, not the VPS.
- On your local Windows machine, open a browser and navigate to https://whatismyipaddress.com/ (or search "what is my IP" on Google).
- Note your public IPv4 address and keep it handy for the next substep.
Why does my IP matter here?
Windows Firewall can filter inbound connections by the remote IP address that initiated them. By allowing only your home IP and blocking everything else, the RDP port becomes unreachable to the rest of the internet.
Restrict RDP access to your IP only
You will create two rules in sequence. The allow rule must come first because Windows Firewall evaluates allow rules before block rules at the same specificity level.
- Switch back to your RDP session on the VPS.
- Open Command Prompt as Administrator (right-click the Start menu, then click Command Prompt (Admin) or Windows Terminal (Admin)).
- Create the allow rule by running this command:
netsh advfirewall firewall add rule name="Allow RDP from My IP" dir=in action=allow protocol=TCP localport=3389 remoteip=[[HOME_IP="your public IPv4 address"]]
What does this command do?
- name="Allow RDP from My IP" gives the rule a human-readable label.
- dir=in targets inbound traffic (connections coming into the VPS).
- action=allow permits matching traffic through.
- protocol=TCP localport=3389 scopes the rule to RDP's default port.
- remoteip= restricts the rule to connections originating from your specific IP.
You should see Ok. printed in the console, confirming the rule was created.
- Now create the block rule by running this command:
netsh advfirewall firewall add rule name="Block RDP All Others" dir=in action=block protocol=TCP localport=3389
What does this command do?
This rule blocks all inbound TCP traffic on port 3389 regardless of the source IP. Because the allow rule you created first is more specific (it names your IP), Windows matches your traffic against the allow rule before it ever reaches this blanket block.
You should see Ok. again, confirming the block rule was created.
Do not reverse the rule order
If you accidentally create the block rule without the allow rule in place first, you will immediately lose RDP access. If this happens, use the Kamatera web console (available from your server's dashboard page) to log in and delete the block rule.
Verify the firewall rules and test access
- Confirm both rules exist by running these commands:
netsh advfirewall firewall show rule name="Allow RDP from My IP"
netsh advfirewall firewall show rule name="Block RDP All Others"
Each command prints a summary including the rule name, direction, action, protocol, local port, and remote IP filter. Confirm that Allow RDP from My IP shows Action: Allow with your IP in the RemoteIP field, and that Block RDP All Others shows Action: Block.
Before you test the final step, predict what will happen: if you disconnect your RDP session right now and try to reconnect, will your connection succeed or fail?
- Close your RDP session by clicking the X on the Remote Desktop window (this disconnects without logging out).
- Wait about 10 seconds, then reconnect using the same method as before: press Win + R, type mstsc, enter your VPS IP, and log in with your Administrator credentials.
Your connection succeeds because your home IP matches the allow rule. Anyone connecting from a different IP would be blocked.
Can't reconnect after setting firewall rules?
- Your home IP may have changed since you looked it up (common with dynamic ISP addresses). Check your current IP again and update the allow rule.
- If you are completely locked out, log in through the Kamatera web console (go to your server in the Kamatera dashboard and click the console/VNC option). From there, delete the block rule and recreate it with your updated IP.
- help me fix my firewall rules so I can reconnect to my VPS via RDP
Your VPS is now locked down. Only your home IP can reach the RDP port, and your bot continues running in the background via Task Scheduler. You have a fully deployed, secured, 24/7 trading bot.
Secret mission
Add a Health-Check Watchdog Script
Your bot might crash due to network hiccups, Telegram API errors, or MT5 disconnections. A production system needs a watchdog that detects when the bot dies and brings it back automatically. In this secret mission, you will build a self-healing batch script that monitors your bot every 5 minutes and restarts it if it goes down.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project uses a Kamatera Cloud VPS covered by their 30-day free trial, so there are no costs during that period.
Cost warning
After 30 days, your Kamatera VPS will cost approximately $18/month if not terminated. Kamatera will begin charging your credit card automatically when the trial ends.
If you do not plan to keep the bot running long-term, terminate the server before the 30-day trial ends to avoid all charges.
Resources you used:
- Kamatera Cloud VPS (Windows Server 2022 Datacenter, 2 Availability Cores, 4 GB RAM, 30 GB NVMe SSD).
- GitHub Private Repository (signal-copier-bot).
Keep everything running
No action needed. Choose this if you want your bot to continue copying Telegram signals to MT5 around the clock.
- After the 30-day trial, expect approximately $18/month for the VPS.
- Monitor your billing from the Kamatera dashboard to avoid surprises.
- Your GitHub private repository remains free on any GitHub plan.
Pause - I'll come back to this later
Power off the server to stop hourly compute billing. Your bot will stop running while the server is off, but your files and configuration remain intact.
- In the Kamatera dashboard, select your server and click Power Off.
- Storage costs may still apply while the server is powered off. Check Kamatera's billing page for details.
- When you are ready to resume, power the server back on from the dashboard and reconnect via RDP.
Delete - I don't want to use this again
Remove all project resources to avoid any future charges. This is permanent and cannot be undone.
- Terminate the Kamatera VPS: in the Kamatera dashboard, click Servers, select your server, then click Terminate. Confirm the termination. This destroys all data on the server including your bot files, Python, MetaTrader 5, Task Scheduler tasks, and firewall rules.
- Delete the GitHub repository: on GitHub, navigate to your signal-copier-bot repository. Click Settings. Scroll down to the Danger Zone section and click Delete this repository. Type the repository name to confirm, then click I understand the consequences, delete this repository.
Nice Work!
Nice Work!
You just deployed a trading bot to the cloud. Your Telegram-MT5 Signal Copier Bot now runs 24/7 on a remote Windows VPS, copying signals whether your laptop is on or off.
You've learned how to:
- Deploy a Python bot to a Windows Server 2022 VPS on Kamatera, replicating your full local environment via RDP and pulling code from GitHub with a single command.
- Configure Windows Task Scheduler so your bot auto-starts on every VPS reboot and keeps running after you disconnect your RDP session.
- Harden a public-facing server with Windows Firewall rules that restrict RDP access to your home IP address only, making the server invisible to attackers.
- (Secret Mission) Build a watchdog batch script that monitors your bot every 5 minutes and automatically restarts it if it crashes, logging every event to a timestamped log file.
Ready to quiz yourself?