Telegram bot hosting with webhooks or polling

Deploy your bot in python-telegram-bot, aiogram, Telegraf or grammY. Use long polling with nothing to configure, or turn on an HTTPS subdomain to receive webhooks.

From R$12.49/mo

99.99%

Average observed uptime

<5s

From upload to bot online

1 ms

Latency to the database

What you can put online on Telegram

Assistants, alerts, shops and groups, with the bot answering through polling or webhooks, always on.

  • AI assistants

    Chatbots that call a language model API, answer questions and triage support.

  • Notifications and alerts

    Price alerts, system status and scheduled notices for users, groups or channels.

  • Sales and payments

    Catalog, cart and payments through the Bot API, with the order stored in your database.

  • Groups and communities

    Moderation, welcome messages, polls and points for groups with thousands of members.

Your Telegram libraries, no changes needed

Bot API or MTProto, polling or webhooks: deploy with the library you already use, in Node.js or Python.

  • Telegraf

    A middleware framework for the Bot API, with TypeScript, scenes and webhooks.

    $npm i telegraf
  • grammY

    A TypeScript-first framework with full Bot API types and plugins for sessions, menus and conversations.

    $npm i grammy
  • node-telegram-bot-api

    A direct Bot API client with polling and webhooks. Simple for small and medium bots.

    $npm i node-telegram-bot-api

pyTelegramBotAPI, Gramio, teloxide and any library that uses the Bot API or MTProto run too.

From code to a live bot in three steps

No Dockerfile and no server to configure. You choose where the code comes from.

  1. 1

    Send the code

    Connect a GitHub repository, use the CLI or upload a .zip in the dashboard.

  2. 2

    Configure your way

    The dashboard generates squarecloud.app from the runtime, memory and entry file you pick. Or write your own at the project root.

  3. 3

    Bot online

    The container starts in under 5 seconds. With GitHub connected, every push to the configured branch updates the files and restarts the bot.

Everything your bot needs to stay online

Included with every Discord, Telegram or WhatsApp bot. When a feature depends on the plan, the card says which one.

  • Always on

    The bot's container runs nonstop: it never sleeps on inactivity and restarts automatically if the process exits.

    • No sleep on inactivity
    • Automatic process restart
    • 99.99% average observed uptime
  • Isolated container

    Each bot runs in its own container, with its own vCPU, RAM and disk. You pick the memory at deploy and change it when you need to.

    • Its own vCPU, RAM and disk
    • Memory you set
  • Live logs and status

    Follow the bot's console in real time and see whether it is online, restarting or stopped.

    • Console in the dashboard
    • Logs in the CLI and VS Code
    • Status and logs in the mobile app
  • Usage metrics

    CPU, RAM and network for each bot, collected every 5 minutes and kept for 24 hours, so you know when it needs more memory.

    • CPU, RAM and network per application
    • 24-hour history
    • On applications with 512 MB of RAM or more
  • Snapshots

    Take a snapshot before a risky update and restore the bot if something goes wrong.

    • Manual snapshots on every plan
    • Daily snapshots from Pro, kept for 7 days
    • The latest one stays available for up to 30 days
  • HTTPS for webhooks

    Turn on web publishing and the bot gets a squareweb.app subdomain with TLS, ready for Telegram webhooks, the WhatsApp Cloud API or Discord interactions.

    • squareweb.app subdomain with HTTPS
    • TLS certificate issued and renewed automatically
    • Custom domain from Standard

Keep your bot's data in the same datacenter

MongoDB, Redis, PostgreSQL and MySQL Hosting in the same dashboard as your applications, with 1 ms average connection latency. Available from the Standard plan.

A plan for every stage of your project

Start small and scale when you need to, with no loyalty contracts.

4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot

Hosted in a partner datacenter with certifications
Tier 3ISO 27001SOC 2 Type IIAlways-On DDoS Protection
Explore our infrastructure

Frequently asked questions about Telegram bot hosting

Everything about webhooks, long-polling, libraries and media bots on Telegram.

Does Square Cloud support python-telegram-bot, Telegraf and Aiogram?

Yes, all of them. Also Telethon, node-telegram-bot-api, grammY and any library that uses the Telegram Bot API.

Should I use webhooks or long-polling for my Telegram bot?

For minimum latency and resource usage, webhooks are better. Set up a squareweb.app subdomain with HTTPS in the application's Domains tab (your app must listen on port 80); the certificate is issued and renewed automatically. Long-polling also works with no extra setup.

How do I set up a Telegram webhook pointing to my application?

Set up a squareweb.app subdomain with HTTPS in the application's Domains tab (your app must listen on port 80) and use that URL in the Bot API's setWebhook call. Since the certificate is issued and renewed automatically, Telegram doesn't need the certificate parameter.

Can I use the same account for the Telegram bot's database?

Yes. From the Standard plan up, you can provision MongoDB Hosting, PostgreSQL Hosting, MySQL Hosting or Redis Hosting on the same dashboard and connect with ~1ms latency.

Are media bots (video, photo, audio) slow on Telegram?

No. The uplink is 10 Gbps and NVMe Enterprise handles large file upload/download from Telegram well (up to the Bot API's 50 MB / 2 GB Premium limit).

How do I host a userbot (Telethon) on Square Cloud?

It works normally: userbots use the MTProto API. Just make sure your session file (.session) is persisted on the application's disk.

Ready to scale your project?

Join the 500,000+ developers who have used Square Cloud to host their projects.

  • Predictable pricing
  • No billing surprises
  • Deploy in seconds
  • High availability
  • Scale with stability
  • Automatic restart
  • SSL and security included
  • Isolated containers