Telegram bot hosting
Keep your bot running after you close your laptop. Deploy a Python bot as a persistent application, store its token in an environment variable, and inspect its runtime logs in Inquir Compute.
Last updated: 2026-10-26
From source code to a running service
Create a bot with BotFather and add BOT_TOKEN to the application variables. Use one replica for this polling example and keep the service private: it does not need an incoming HTTP route.
Deployment steps
Prepare the project
Add the example files or use your existing project. Install dependencies and check the start command locally before deploying.
Configure the application
Create an application in your workspace. Choose the source, start command, environment variables and resource allocation. Web services need a route port; polling bots can remain private.
Check the release
Deploy and inspect build and runtime logs. Test web routes on the preview URL. For a polling bot, send /start in Telegram and ensure another process is not using the token.
Publish and monitor
Promote a verified web release to production. Keep database migrations separate from application rollback. Monitor errors and resource use after the update.
A minimal project
These examples show application code and startup, not a preconfigured infrastructure template. Test and lock your dependencies before using them in production.
aiogram>=3,<4
import asyncio import 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("Hello from Inquir!") async def main(): async with Bot(token=os.environ["BOT_TOKEN"]) as bot: await dp.start_polling(bot) if __name__ == "__main__": asyncio.run(main())
python bot.py
Choose polling or webhook
Polling retrieves updates from Telegram and needs a continuously running process. A webhook receives updates at a public HTTPS endpoint. Do not run both modes for the same bot token.
Keep the bot token out of Git
Read BOT_TOKEN from the environment. Do not put it in source files, screenshots or logs. Keep application data in a database or a persistent volume rather than the container filesystem.
FAQ
Why does Telegram report a polling conflict?
Another process is fetching updates with the same token. Stop the local bot before starting the cloud instance. For polling updates, avoid overlapping old and new processes; stop the old instance before starting its replacement.
Does the bot need a domain?
Not for polling. Webhooks and Mini Apps need a public HTTPS address. A Mini App frontend is a separate web application; the polling example here only runs the bot.
Can I store SQLite data?
Mount a persistent volume and place the database file inside its mount path. Keep this setup to one application replica. A volume preserves files across container replacement; it does not replace a tested backup procedure.
How much does hosting cost?
Check the current plans and available payment offers in Plan & billing. Size the application and its dependencies against the shared resource pool. Preview replicas and databases also consume resources; an idle application is not automatically free.