If you build a Telegram bot with aiogram 3 (or Pyrogram / python-telegram-bot) and store user state in SQLite or .session files, deploying to a typical free web PaaS usually ends in two ways:

  1. Your bot goes silent after 15 minutes because no inbound HTTP traffic hit the container.
  2. Every restart wipes your local bot_data.db because the container disk is ephemeral.

Here is a copy-pasteable aiogram 3 + sqlite3 starter and how to run it 24/7 for free on persistent x86_64 NVMe storage without a credit card.

Quick Comparison: Why Most Free Tiers Break Polling Bots

Hosting Type Sleep Timer? Persistent SQLite / .session? Free RAM / Arch Credit Card?
HTTP-First Free PaaS (e.g. Render Free) Yes (15 min idle) No (ephemeral wipe) 512 MB No
Micro Bot Containers No Often tight disk 100–128 MB (easy OOM) No
Arm64 Free Nodes Weekly renew Yes Arm64 (native wheel issues) No
BotHoster (Pterodactyl Docker) No (24/7) Yes (2 GB NVMe) 512 MB x86_64 No

Step 1: Minimal aiogram 3 + Persistent SQLite Bot

Create main.py:

import asyncio import os import sqlite3 from aiogram import Bot, Dispatcher, types from aiogram.filters import CommandStart from dotenv import load_dotenv load_dotenv() TOKEN = os.getenv("BOT_TOKEN") conn = sqlite3.connect("bot_data.db") conn.execute( "CREATE TABLE IF NOT EXISTS users (user_id INTEGER PRIMARY KEY, username TEXT)" ) conn.commit() dp = Dispatcher() @dp.message(CommandStart()) async def start_handler(message: types.Message): conn.execute( "INSERT OR REPLACE INTO users (user_id, username) VALUES (?, ?)", (message.from_user.id, message.from_user.username or "unknown"), ) conn.commit() await message.answer("Bot is live 24/7 and your profile is persisted in SQLite!") async def main(): bot = Bot(token=TOKEN) await dp.start_polling(bot) if __name__ == "__main__": asyncio.run(main()) 

Create requirements.txt:

aiogram>=3.10.0 python-dotenv>=1.0.1 

Step 2: Deploy 24/7 on BotHoster in Under 3 Minutes

BotHoster runs isolated x86_64 Docker containers orchestrated by Pterodactyl Wings on NVMe SSD nodes (Sydney cluster—especially fast for APAC, Vietnam, and Australia):

  1. Sign in via Discord OAuth or Email at bothoster.top (zero credit card needed).
  2. Create a Basic (512 MB RAM / 2 GB NVMe) container and pick the Python 3.12 egg (12 runtimes supported total, including Node.js, Bun, Go, Rust, Java, C#, Deno, Dart, Elixir, Lua).
  3. Click Panel SSO, upload main.py, requirements.txt, and .env (BOT_TOKEN=your_token) via Web File Manager or SFTP.
  4. Set main.py in the Startup tab and click Start in Console.

Transparent Billing Notes

  • Free containers run on pay-as-you-go hourly coins (1.00 Coin/hr earned via dashboard AFK earner, tasks, or referrals).
  • Stopping your container freezes coin deductions immediately, and hitting zero balance gives a 3-day grace period (your bot_data.db stays intact).
  • Live cluster RAM, ping, and 90-day uptime are public at bothoster.top/status.

Drop a comment if you run into any aiogram or Pterodactyl setup issues!