Contents
The bot is code you write; Telegram doesn’t run it for you. Telegram’s servers hold the messages sent to your bot, and your code has to be available all the time to pick them up and reply. Shut your laptop or let the server stop, and the bot goes silent. Bot hosting simply means a place that keeps that code running day and night and restarts it when it crashes.
Why free bot hosting keeps stopping
Many people searching for free Telegram bot hosting try a free platform and find the bot offline a few hours later. The reasons repeat:
- Sleeping apps: many free plans stop an app after a period without web visits and only wake it when an HTTP request arrives. A polling bot never receives HTTP requests, so it goes to sleep and stays there.
- Monthly hour caps: the bot stops before the month ends.
- Ephemeral disks: files are wiped on restart, taking your SQLite database and user data with them.
- Keep-awake tricks: pinging the bot’s URL every few minutes from an outside service is fragile and may break the platform’s terms.
ArabyHost is paid, not free. If you’re only learning, run the bot on your own machine first and read the real free hosting options and their limits. Once real users depend on the bot, you need a process that doesn’t sleep.
What a Telegram bot needs to run
- A language and version: Python with a library such as python-telegram-bot or aiogram, or Node.js with grammY or Telegraf. Check which language version your library supports.
- The bot token from @BotFather, stored in an environment variable or a
.envfile kept out of your repository: whoever has the token controls the bot. - A way to receive updates: polling or a webhook.
- Storage: a SQLite file for a small bot, or MySQL/MariaDB as users grow.
- A process supervisor that restarts the bot when it crashes.
| Polling | Webhook | |
|---|---|---|
| How it works | Your code calls getUpdates continuously |
Telegram sends every update to an HTTPS URL |
| Needs a domain | No | Yes, with an SSL certificate |
| Process type | A permanent background process | A web app started when requests arrive |
| Good for | Getting started and most small to medium bots | Bots built as web apps, or written in PHP |
Pick one method. Mixing them, or running two copies with the same token, causes the 409 Conflict error.
Which ArabyHost plan fits a bot
The AI and Developer plans are the right fit for Python and Node.js bots: SSH inside CageFS, Python 3.9 to 3.12, Node.js 20 and 24, apps through Passenger, and cron jobs that keep background workers alive. You can also run Claude Code or Codex over SSH to write and debug the bot on the server itself.
The shared plans don’t run Python or Node.js and have no SSH. The exception is a PHP bot that uses a webhook: it’s a regular PHP file and runs on any plan.
How the bot runs here
- In cPanel’s Setup Python App, create an app with version 3.12; it gets its own virtual environment.
- Upload the code with Git or SSH and install packages inside that environment with
pip install -r requirements.txt. - Put the token in a
.envfile inside the bot folder (not inpublic_html) and load it with a library such aspython-dotenv. - For polling: add a cron job that runs every minute.
flockstops a second copy from starting while the first is alive, and restarts the bot if it died:
* * * * * /usr/bin/flock -n /home/USER/bot.lock /home/USER/virtualenv/bot/3.12/bin/python /home/USER/bot/bot.py >> /home/USER/bot/bot.log 2>&1
- For a webhook: run the bot as a web app on a subdomain such as
bot.example.com, register the URL withsetWebhookand asecret_token, and reject any request without the matchingX-Telegram-Bot-Api-Secret-Tokenheader.
The full steps with code are in the Python Telegram bot guide, and the cron generator helps with the schedule.
What’s included
- Free automatic SSL, which webhooks require.
- Daily JetBackup backups of your code and database.
- Each account isolated with CageFS and its own resource limits.
- Outbound connections allowed to the Bot API, and to AI APIs if your bot uses them.
- The Araby AI assistant reads error logs and explains the fix, plus support in Arabic.
Limits to know
- No root, no Docker: if your project relies on
docker compose, run it directly with Python or Node instead. - No GPU: you can’t run AI models locally; call an API instead.
- Per-plan resources: a bot serving very large numbers of users, or processing video, can hit CPU or memory limits.
- No ports open to the internet: a webhook reaches the bot over HTTPS on your domain only.
- Cron-based restarts happen within a minute of the process stopping, not instantly.
On ArabyHost
Order an AI and Developer plan, enable SSH from the Araby Panel, create a Python 3.12 app and add the cron job above. If the bot currently runs on your own computer, stop it before starting it on the server so two copies don’t share the token. If the bot stops and you can’t tell why, start with the last lines of bot.log, use the Araby AI assistant, which reads error logs and explains fixes, or contact our Arabic-speaking support.
FAQ
Is there free Telegram bot hosting that runs 24/7?
Free plans exist, but they usually stop an app after a period without web traffic or cap its running hours per month, and a polling bot gets no web traffic, so it stops. ArabyHost is a paid service; while you're learning, running the bot on your own computer is enough.
Should I use polling or a webhook?
Polling is simpler and needs no domain; it runs as a background process that cron keeps alive. A webhook needs an HTTPS URL and runs as a web app. Use only one: mixing them causes the 409 Conflict error.
Will a PHP Telegram bot run on shared hosting?
Yes, if it uses a webhook, because it's then an ordinary PHP file receiving Telegram's HTTPS requests. Python and Node.js bots need the AI and Developer plans.