Your bot runs as a long-lived Node.js process. That means it needs somewhere to live that is not your laptop. Here is a practical look at your options, from completely free to $5/month.
Option 1 - Railway (recommended for beginners)
Railway has a free hobby plan that gives you $5 of compute credits per month. A grammY bot with no heavy workload uses around $0.50-$1.00/month, so the free credits usually cover it.
Setup:
- Push your bot code to GitHub
- Go to railway.app → New Project → Deploy from GitHub
- Set your `.env` variables in the Railway dashboard
- Railway detects Node.js automatically and runs `npm start`
Railway gives you persistent storage (required for sql.js to save your database between restarts), automatic redeploys on push, and a clean dashboard for logs.
Option 2 - Render
Render's free tier spins down after 15 minutes of inactivity, which breaks long-polling bots. You need the paid tier ($7/month) for always-on processes.
For a grammY bot using long polling, Render free does not work. For webhooks it can, but the setup is more complex. Skip Render free for bots.
Option 3 - Fly.io
Fly.io has a generous free allowance: 3 shared-CPU VMs with 256MB RAM each. That is more than enough for a grammY bot.
Setup:
- Install the Fly CLI: `curl -L https://fly.io/install.sh | sh`
- Run `fly launch` in your bot folder
- Set secrets: `fly secrets set BOT_TOKEN=your_token`
- Deploy: `fly deploy`
Fly.io requires a credit card on file even for free usage, but will not charge unless you exceed the free allowance.
Option 4 - A $5 VPS
A basic VPS from DigitalOcean, Hetzner, or Vultr gives you full control. Hetzner's cheapest server (CAX11) is €3.29/month and runs dozens of bots simultaneously.
Run your bot with pm2 for automatic restarts:
npm install -g pm2
pm2 start "npx ts-node index.ts" --name my-bot
pm2 startup
pm2 saveThis is the most reliable option for production groups. No cold starts, no credit limits, full SSH access.
Option 5 - Your own PC (free, limited)
Running the bot on your own computer works fine for testing. The included `Step 2 - Start Your Bot.bat` does exactly this. The limitation: your bot goes offline when your computer sleeps or loses internet.
For a small group where occasional downtime is acceptable, this is zero-cost.
Summary
| Option | Cost | Reliability | Setup difficulty |
|---|---|---|---|
| Railway hobby | Free ($5 credit/mo) | Good | Easy |
| Fly.io | Free tier | Good | Medium |
| $5 VPS | ~$4-5/month | Excellent | Medium |
| Render free | Free | Poor (spins down) | Easy |
| Own PC | Free | Low | Trivial |
The included `Advanced - Hosting Guide.md` in your BotForge download covers Railway and the VPS option step by step.
Get your bot code at tgbotforge.com - the hosting guide is included in every download.