ESN Docs

Docs › Discord bots

How to host a Telegram bot on ESN Hosting (Python or Node.js)

Run a Telegram bot 24/7 on ESN: pick Telegram bot at checkout, put your @BotFather token in BOT_TOKEN, upload your code and press Start.

ESN runs Telegram bots on the same plans as Discord bots, from Nano ($0.50/month) up. There are Telegram setups for Python (python-telegram-bot, aiogram, pyTelegramBotAPI, Telethon), Node.js / TypeScript (grammY, Telegraf, node-telegram-bot-api), plus Go, Java/Kotlin, PHP and Ruby.

1. Get a server

  1. Open the panel's Plans page (create an account first if you're new).
  2. Under What do you want to host?, pick the Telegram bot type for your language, then Buy a plan. Small bots run fine on Nano or Starter.

2. Add your bot token

  1. Get a token from @BotFather in Telegram (/newbot).
  2. Open your server's Startup tab and paste it into BOT_TOKEN.
  3. Read it in your code from the environment instead of writing it in the file:
import os
TOKEN = os.environ["BOT_TOKEN"]
const token = process.env.BOT_TOKEN;

Keeping the token in Startup means it never ends up in your files or a Git repo.

3. Upload your code

  • Python: upload your files and a requirements.txt (installed on every start). Set MAIN_FILE to the file that starts your bot (default bot.py).
  • Node.js: upload your files with package.json. Set MAIN_FILE (default index.js). .ts files run directly; set BUILD_ON_START to 1 if your project compiles with npm run build.
  • Or put your GitHub/GitLab repo in GIT_ADDRESS, and set AUTO_UPDATE to 1 to pull the latest code on every start. Private repos need a USERNAME and an ACCESS_TOKEN (a personal access token, never your password).

See Uploading files for the file manager and SFTP.

4. Start it

Press Start and watch the Console. Then message your bot in Telegram. If it doesn't answer, check the Console for errors and see Troubleshooting.

Only one copy at a time: Telegram lets one program poll a bot token. If the bot also runs on your PC, stop that copy, or you'll see "Conflict: terminated by other getUpdates request".

Still stuck? Use the live chat on the panel or ask in the ESN Hosting Discord. Last updated October 27, 2026.