Deploy an aiogram bot: connect the repo and it runs

Your aiogram 3 bot works on your laptop but dies when you close the lid? Connect the repo to Dada Cloud and the platform builds it and runs it as a permanent process. Long polling needs no domain; webhook mode gets an HTTPS address. Free tier, servers in Russia.

Why aiogram bots are deployed here

Long polling without a domain

An aiogram bot using dp.start_polling runs as a background worker: a permanent process, no public address needed or issued.

Webhook with HTTPS included

If you use setup_application with aiohttp, the app gets an address with a valid certificate - hand that one to set_webhook.

Builds from requirements.txt

Having aiogram in your dependencies is enough. No Dockerfile to write, no command line to learn.

FSM state survives restarts

MemoryStorage loses conversations on every deploy. Attach managed PostgreSQL or Redis and users continue from the same step.

Crashes restart themselves

An unhandled exception in a handler or a dropped connection to Telegram - the process restarts automatically.

Data in Russia (152-FZ)

Your bot users' data is stored on servers inside Russia - what the personal-data law requires.

How to deploy an aiogram bot

Six steps from a local script to a bot that runs around the clock.

01

Pin your dependencies

aiogram must be in requirements.txt - that file is how the platform knows the project is Python and installs dependencies at build time.

02

Take the token out of the code

Replace the hardcoded token with os.environ["BOT_TOKEN"]. A local .env is handy for development but must not reach the repo.

03

Create the app in worker mode

For long polling turn on background-worker mode. For a webhook create a regular app - it gets an HTTPS address.

04

Connect the repo

Connect GitHub and every push to the main branch builds and ships a new version. Without git, a zip archive works.

05

Set environment variables

BOT_TOKEN, admin ids and third-party API keys are set in the console and injected at start.

06

Attach a database for FSM

Create PostgreSQL next door and move state storage off MemoryStorage - then a deploy stops dropping users mid-scenario.

What aiogram bot hosting costs

Real platform tiers, and an honest comparison with renting your own VPS.

TierPriceWhat you get
Free0 ₽/moOne bot with a database, no card required. The limit is resources, not a trial clock.
Startup990 ₽/mo5 apps, 2 databases, 7-day backups - a bot, an admin panel and a broadcast worker.
Business2,900 ₽/mo20 apps, 10 databases, 30-day backups, priority support.
Your own VPScomparable on hardwareA VPS is cheaper per unit of hardware. But systemd, database backups and restarts after a crash cost your time.

Worth knowing up front

Three places an aiogram deploy usually trips.

Two copies with one token conflict

If a local copy keeps polling Telegram, updates go to it or to production at random. Stop the local process after deploying, or create a separate test bot.

MemoryStorage loses conversations on deploy

FSM state in process memory is wiped on every build and users get stuck mid-scenario. A production bot needs persistent storage.

Files on disk do not survive a build

Photos and documents downloaded to the local disk disappear on the next deploy. Keep them in object storage and the links in a database.

Deploying an aiogram bot - FAQ

Long polling or webhook for aiogram?

Long polling is simpler: dp.start_polling, no public address, run it as a background worker. A webhook reacts faster and is cheaper at scale, but needs an HTTPS address and an aiohttp server in your code. Start with polling and switch when you hit the ceiling.

How do I deploy an aiogram 3 bot?

Connect a repo where aiogram is in requirements.txt, turn on background-worker mode, set BOT_TOKEN in the environment - the platform builds and runs the bot. It usually takes a couple of minutes.

Where do I keep BOT_TOKEN?

In the app's environment variables, set in the console. Never commit it: Telegram revokes leaked tokens.

Why does the bot lose conversation state after a deploy?

Most likely MemoryStorage: FSM state lives in process memory and is wiped on restart. Attach PostgreSQL or Redis as storage and the scenario continues from the same step.

Do I need a Dockerfile?

No, not if the bot builds from requirements.txt. A Dockerfile helps when you need an unusual system dependency - ffmpeg for voice messages, for example.

Can I run a test bot and a production bot?

Yes, that is two apps with two different tokens. The free plan fits one; the second needs Startup. The same token cannot run in two processes: Telegram would hand updates to one or the other at random.

How do I find out why the bot is silent?

Process logs are in the panel. Common causes: it died on startup from a bad token, a getUpdates conflict with a copy still running locally, or an unhandled exception in a handler.

What does it cost?

Your first bot runs on the Free tier with no card. After that it is Startup at 990 ₽/mo or Business at 2,900 ₽/mo, paid by ruble card.

Give your code a public address

Create an account and deploy your first app. The Free plan costs $0.

Create account