Free Hosting

Free Hosting for Telegram Bots: Getting Started

Run a Telegram bot 24/7 for free — what the free plan includes, a minimal bot in three libraries, uploading and starting it, and keeping it within 256 MB.

On this page
  1. What the free Telegram plan includes
  2. Step 1: Get a token
  3. Step 2: Write a minimal bot
  4. Step 3: Create your free server
  5. Step 4: Upload and configure
  6. Step 5: Start it
  7. Keeping a free Telegram bot healthy
  8. When to move to Starter
  9. Summary

Telegram bots are some of the lightest programs you can host, which makes them a perfect fit for a free plan. A typical long-polling bot idles around 70 MB of memory — well inside Kerit Cloud’s free 256 MB. This guide covers what the free plan gives you, a minimal bot in the three most popular libraries, and how to get it running around the clock.

What the free Telegram plan includes

Resource Free plan
RAM 256 MB
CPU 30% of an AMD EPYC core
Storage 2 GB NVMe, persistent
Database Shared MySQL
Sleep mode None — the process runs 24/7
Automatic restarts Yes
Latency to the Telegram API Under 40 ms from the Virginia edge
Card required No

There’s no trial timer; the plan is free forever. Long polling works because your process never sleeps, and webhooks work too — each server gets an HTTPS endpoint you can register with Telegram. Session files for Telethon and Pyrogram persist on disk, so userbots don’t ask to log in again after a restart.

Git deploy and automatic daily backups start on the Starter plan; on Free you upload files through the panel’s file manager or SFTP.

Step 1: Get a token

Message @BotFather on Telegram, send /newbot, choose a display name and a username ending in bot, and copy the token. Keep it private — anyone with it controls your bot. If it leaks, /revoke in BotFather issues a new one.

Step 2: Write a minimal bot

Pick whichever library you like. Each example reads the token from an environment variable and uses long polling.

aiogram 3 (Python)

import asyncio, os
from aiogram import Bot, Dispatcher
from aiogram.filters import CommandStart
from aiogram.types import Message

dp = Dispatcher()

@dp.message(CommandStart())
async def start(message: Message):
    await message.answer("Hi! I'm running 24/7 on a free server.")

@dp.message()
async def echo(message: Message):
    await message.send_copy(message.chat.id)

async def main():
    await dp.start_polling(Bot(os.environ["BOT_TOKEN"]))

asyncio.run(main())

requirements.txt: aiogram>=3.4,<4

pyTelegramBotAPI (Python)

import os, telebot

bot = telebot.TeleBot(os.environ["BOT_TOKEN"])

@bot.message_handler(commands=["start"])
def start(message):
    bot.reply_to(message, "Hi! I'm running 24/7 on a free server.")

bot.infinity_polling()

requirements.txt: pyTelegramBotAPI>=4.20,<5

grammY (Node.js)

const { Bot } = require('grammy');

const bot = new Bot(process.env.BOT_TOKEN);
bot.command('start', (ctx) => ctx.reply("Hi! I'm running 24/7 on a free server."));
bot.on('message', (ctx) => ctx.copyMessage(ctx.chat.id));
bot.catch((err) => console.error(err));
bot.start();

package.json dependency: "grammy": "^1.30.0", with a "start": "node bot.js" script.

Deeper guides: aiogram 3, pyTelegramBotAPI and grammY.

Step 3: Create your free server

  1. Join the Kerit Cloud Discord and register on the panel using the link shared there — no card or email verification needed.
  2. Create a server on the Free plan and choose your runtime: Python (3.9–3.12) or Node.js (16–22). Java, Go, Bun and Deno are available too.

The full signup walkthrough is in how to claim your free server.

Step 4: Upload and configure

  1. Upload your bot file and requirements.txt or package.json through the file manager or SFTP. Skip venv/, node_modules/ and .env.
  2. Add BOT_TOKEN as an environment variable in the panel — it’s stored encrypted and never shown in logs.
  3. Set the start command: python -u bot.py for Python (the -u makes logs appear instantly) or npm start for Node.js.

Step 5: Start it

Press Start and watch the console. Dependencies install, then the bot begins polling. Message your bot — the reply should arrive almost instantly.

Warning: Stop any copy of the bot running on your own computer. Two processes polling the same token produce 409 Conflict: terminated by other getUpdates request, and updates get split between them.

If the bot crashes, the watchdog restarts it within seconds, and the error stays in the console.

Keeping a free Telegram bot healthy

Store data in the database, not memory. The free plan includes a shared MySQL database. Use it for users, settings and anything that must survive restarts — see using the shared MySQL database. SQLite on the persistent disk also works for small bots.

Keep conversation state persistent. aiogram’s default in-memory FSM storage is wiped on restart and grows with every abandoned conversation. For a small bot, a state column in your users table is a simple durable alternative.

Handle errors. A global error handler in any of these libraries stops one malformed update from taking the bot down.

Respect Telegram’s limits. About one message per second per chat, twenty per minute per group and thirty per second overall. See Telegram Bot API limits.

Watch memory. Most Telegram bots stay far below 256 MB. The usual causes of growth are in-memory sessions, unbounded dictionaries and media held in memory — stream files to disk instead.

Keep the server active. Active servers stay forever; only long-stopped, untouched servers are reclaimed, with a warning on Discord first. See the reclaim policy.

When to move to Starter

The free plan runs most personal and small community bots indefinitely. Consider Starter (₹99/month) when you want:

  • Git deploy, so every push to your repository redeploys the bot.
  • Daily backups of your data.
  • Your own MySQL database rather than a shared one.
  • More room — 1 GB of RAM and a full EPYC core — for media processing, more users or Telethon clients with large caches.
  • Reliability you can promise, since paid plans are covered by the SLA.

Upgrades happen in place with one click: session files, database and environment variables all stay, so userbots won’t need to log in again. See choosing a Telegram bot plan.

Summary

A Telegram bot fits comfortably on a free plan: 256 MB of RAM, 30% of an EPYC core and 2 GB of persistent NVMe, running 24/7 with no sleep mode and under 40 ms to the Telegram API. Get a token from BotFather, write a small bot that reads it from the environment, upload it, set BOT_TOKEN and the start command, and press Start. Keep data in the included database, handle errors, and upgrade to Starter when you want git deploy, backups and more room.