Menu

Build a Private Telegram AI Bot with Ollama and Docker on a VPS
📰

Build a Private Telegram AI Bot with Ollama and Docker on a VPS

DEV Community: docker·Артем Ахмадеев·about 6 hours ago
#tyTlvhlA
#devtodocker#devto#dev#logs#docker
Long article (1440 words) — no AI summary yet.
Reading 0:00
15s threshold

Cloud AI chatbots are convenient, but every message you send goes to someone else's servers. A public Telegram bot is also open to anyone who finds its username, which is a problem if it can read your server logs. You want a small assistant that lives on your own machine and answers only you.

In this guide we build exactly that: a Telegram bot running in Docker on your VPS. It talks to a tiny local Ollama model, summarizes a server log on request, and ignores everyone except your Telegram ID. Self-hosting keeps your prompts and logs on your own server, costs nothing per request, and needs no GPU.

What you need

A VPS with Ubuntu 24.04 (2 vCPU / 4 GB RAM is plenty). I use VDSina (affiliate link — it supports the channel at no extra cost to you) .

An SSH connection to it (any terminal works).

Short on time? Every command below is also in one ready-to-run script .

Step 1: Update the system

Updating the system refreshes the package list and installs pending upgrades.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.