3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger

3 horizontal lines, burger
Remove all
LOADING ...

Content



    Methods for deploying telegram bots

    Clock
    17.08.2026
    /
    Clock
    17.08.2026
    /
    Clock
    5 minutes
    An eye
    10
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0

    Introduction

    This article will discuss where and how to host a Telegram bot. I'll cover all available options, from free to fairly paid ones.
    The reason I'm writing this article is that I recently ran out of money and had to cut my losses. Consequently, I had to find a new hosting for my bots, and for the same reason, they were unavailable for a couple of months.
    Also, I want to emphasize that I won't be discussing the bot deployment process here. This is merely an introductory article, intended to familiarize the reader with the various hosting options available. More detailed instructions will be available via the links in the relevant chapters.

    How and where can I host a bot?

    Generally, all locations where bots can be hosted fall into one of the following categories:
    Virtual server (VPS/VDS)This is a computer to which you have full access to software with root rights.
    Shared hostingThis is a computer that gives you limited access to software without root rights.
    Free hosting (allegedly)It's the same hosting, but free (allegedly). It's either temporary or has serious limitations.
    Your own hostingThis is the same hosting, but on your own computer. Full controll.
    CategoryShort description
    I've only tried three of the four methods (categories). The last one involves setting up the hardware itself, which I haven't worked with yet, but I'll definitely demonstrate in the future. So subscribe to the RSS feed and email notifications ;)
    Initially, all my bots were hosted on a VPS from beget—it wasn't cheap. But at least I had absolute control, and I could create bots of any complexity.

    Hosting Bots on a VPS/VDS

    I've already written about how to host a telegram bot on virtual servers using Beget as an example, and described in detail the deployment mechanism and subsequent support. So I won't go into too much detail here.
    I'll just say that this option is one of the most expensive (right after self-hosting), but it provides complete control and everything necessary to create and maintain a bot of any complexity.
    There are plenty of this type of hosting options online, so I'll highlight the main ones that are definitely worth trying. They're simply cheaper than shared VPS (like DigitalOcean or Hostinger):
    1. TeleBotHos - a specialized service specifically for hosting bots
    2. JustRunMyApp - also a service for hosting telegram bots, but it offers even more.

    Hosting bots on shared hosting

    I'll be honest, this method isn't suitable for all bots. Some bots may have dependencies that require updating and configuring the server. This, in turn, requires superuser privileges, which you won't have.
    Not all web hosting services support Python, so you should choose your provider first, checking whether they support Python on their hosting.
    Also, you need to consider the very serious space constraints. Web hosting services allocate very little space. Therefore, adhering to best practices won't work, meaning each bot will need its own virtual environment.
    Having a single virtual environment for all bots can lead to dependency collisions and, consequently, errors.
    And one more thing. I'm not sure if this is the case with all web hosting providers, but on mine (Beget), launching a bot requires writing a script, and this script can only run for 10 hours.
    Consequently, you'll also need to use a command like Crontab to ensure the bot can run continuously.
    Crontab is a special file and command in Linux and Unix systems for running programs and scripts automatically and on a precise schedule.
    We'll need it to restart this script:
    #!/usr/bin/env bash cd $HOME/bots/ ; source .venv/bin/activate; python BotName/main.py ;
    Let the script be called start.sh
    This script launches the bot. Note that I'm launching the bot from a shared directory, and the virtual environment there is the same for everyone. Now let's add a crontab rule.
    Typically, on any web hosting service, you can configure such rules through a graphical interface, specifying when to run the command. But if you don't have such an interface, you can write the rule manually:
    # m h d m w COMMAND 0 * * * * /bin/bash ~/bots/BotName/start.sh
    This rule tells the scheduler to execute this script at the start of every hour, every day.
    This way, you can launch and update bots on web hosting services not designed for this. Of course, this method has its own nuances and peculiarities, but a beggar can't be choosers.

    Hosting Bots on *Free Hosting Services

    There are also specialized services called PAAS services. Among them, I would include PythonAnywhere, which I've worked with and tested, as well as Replit, Heroku, Railway, Glitch, and Render...
    Again, I don't want to describe here how to host bots on such services. Each such service has its own ecosystem, and you'll have to adapt to it. I can recommend this article for hosting a bot on PythonAnywhere, as I've tried it myself.
    PaaS (Platform as a Service) is a cloud environment where developers can create, test, and run programs. Without purchasing and configuring servers, programs, or other utilities, everything is ready to go.
    It's important to understand that all of these services are shareware; some have limited RAM, some have a time limit, and some limit the number of programs that can be run. They are good for testing (and only for simple bots). This is a temporary solution that should eventually lead you either to setting up your own VPS or even further, to hosting bots on your own server. That is, of course, if you do anything more complex than a standard Echo Bot.

    Hosting Bots on Your Own Server

    This type of hosting is where any bot developer begins. Yes, running a bot from the console on your computer already qualifies as hosting it on your own server.
    You could take this idea further and buy a Raspberry Pi, connect it and configure the network, install a basic server OS, like Debian, and run your bot there. It will be more expensive, probably 3–4 times more than a regular VPS, but you'll have complete control over your system.
    Of course, not everyone needs complete control over their hardware, but some connoisseurs (myself included) really appreciate it.
    You don't even have to buy anything; you can just use your old laptop, PC, or phone and run it from there. The main thing is that it's always staying online and has high bandwidth, otherwise... Well, I think that's obvious, it won't work.
    There aren't any such experts on the internet yet; at least, Google hasn't shown me any. Well, as soon as I get rich, I'll get into this. But for now, let's move on to conclusions.

    Results and Conclusions

    Initially, I hosted the bots on a Beget VPS, and everything was fine until, due to objective circumstances, I ran out of money. I had to find a way around it and host the bots elsewhere.
    At the time of writing this article, I've hosted the bots on a shared hosting service next to this website; they're literally in the next folder. This is a temporary solution that prevents me from running some bots. But soon I'll be moving the bots back to the VPS with full control and management of the environment.
    What conclusions can I draw? Well, you need to have more money for your needs. Consider your capabilities. Try to design bots with the environment in mind when you plan to run them.

    Do not forget to share, like and leave a comment :)

    Comments

    (0)

    captcha
    Send
    LOADING ...
    It's empty now. Be the first (o゚v゚)ノ

    Other

    Similar articles


    One way to deploy telegram bot on vps

    Clock
    19.01.2024
    /
    Clock
    12.04.2026
    An eye
    14346
    Hearts
    1
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0
    How to deploy a telegram bot on a server and forget about it. Setting up automatic restarts for a bot written in Python.

    How to deploy a Django project on Beget (Either via hosting or VPS)

    Clock
    12.05.2024
    /
    Clock
    11.03.2026
    An eye
    8253
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0
    This is an article on how to deploy django site on beget. I show two methods (deployment either on hosting or VPS). Plus, how to set up and connect a …

    How to deploy a Django website on the timeweb

    Clock
    24.07.2025
    /
    Clock
    15.04.2026
    An eye
    6777
    Hearts
    2
    Connected dots
    1
    Connected dots
    0
    Connected dots
    2
    How to deploy a django website on a timeweb with database configuration, plus setup for a HTTPS redirects and configuration of a nginx, gunicorn and dns