Deploy Telegram bot on Oracle Cloud's free tier
Webhook or long-polling Telegram bots on a server you control, with a real HTTPS endpoint included.
At a glance
| Base image | python:3.12-slim |
|---|---|
| Port | 8080 |
| Build command | pip install -r requirements.txt |
| Start command | python bot.py |
| Infrastructure cost | $0 on Oracle Always Free (platform fee for managed DevOps) |
Running Telegram bot on Ampere ARM
Telegram bots are I/O bound, so a fraction of one Ampere core is enough. Webhooks need HTTPS, which Caddy provides automatically once a domain is attached.
Steps
- Choose webhook or polling. Webhooks are cheaper and instant, but need a public HTTPS URL — attach a domain first.
- Set the webhook after deploy. Call setWebhook once your domain resolves.
curl "https://api.telegram.org/bot$TOKEN/setWebhook?url=https://yourdomain.com/telegram" - Deploy. Add TELEGRAM_TOKEN as a secret and push.
Dockerfile for Telegram bot on ARM64
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["python", "bot.py"]Need one tailored to your repository? The free Dockerfile generator writes an ARM-ready multi-stage build for you.
Common mistakes
- Two instances polling at once: Telegram returns 409 conflicts if an old container is still polling. Blue/green deploys stop the old one first.
- Webhook set to http: Telegram only accepts HTTPS webhook URLs on port 443, 80, 88 or 8443.
- Silent handler exceptions: Log unhandled errors; a crashed handler looks identical to a quiet bot.
Related reading
- /guides/host-discord-bot-free-oracle-cloud
- /oracle-cloud/always-free-arm
- /tools/dockerfile-generator
- All deployment guides
Get the Oracle Always Free deploy checklist
One email with the exact steps, capacity workarounds and tools we use to ship apps for $0 of cloud spend.
One email, no spam. Unsubscribe anytime.
Frequently asked
Do I need a domain?+
Only for webhooks. Long-polling works with no inbound traffic at all.
Can it run alongside other services?+
Yes, the same VM can run a bot, an API and a database.
Is a free tier enough?+
Yes — a typical bot uses a few percent of one ARM core.
Deploy your project for $0
No credit card. No Oracle sales call. Ship to your own cloud in under 10 minutes.
Start free