Getting Started¶
This page takes you from nothing to your first working stream. Follow it in order and you’ll be watching in about 15–20 minutes.
Beginner Tip
You only need to fill in 6 values once in a file called config.env. Everything
else is configured later from a friendly web page — no code, no restarts.
What you need before starting¶
You’ll need a few free accounts and tools. Grab these first so you don’t get stuck halfway:
- Telegram account
A normal Telegram account (the one on your phone is fine).
- A Telegram bot
Created for free through @BotFather (we show you how below).
- Two MongoDB databases
Free forever on MongoDB Atlas (the “M0” tier). This is where your library info lives.
- A place to run the app
A VPS, Hugging Face Space, Heroku, or even your own PC. See Deployment.
- A Stremio-compatible app
Stremio or Nuvio on your phone, TV, or computer.
Good to Know
A TMDB API key (free) is optional but strongly recommended — it’s what fetches posters, descriptions, and organizes your automatic catalogs.
Prerequisites (the technical bits)¶
If you deploy with Docker (recommended), you don’t need to install Python or anything else — Docker handles it. If you run it directly on your machine, you’ll need:
Python 3.10+
MongoDB connection strings (from Atlas)
The Python packages listed in
requirements.txt
Step 1 — Get your Telegram credentials¶
API ID & API HASH — Go to my.telegram.org, log in, open API development tools, and create an app (any title works). Copy the api_id and api_hash.
Bot Token — Open @BotFather in Telegram, send
/newbot, follow the prompts, and copy the token it gives you.Owner ID — Open @userinfobot in Telegram; it replies with your numeric ID.
Common Mistake
After creating your bot, you must add it as an admin in every channel you’ll use for media. If you forget this, no files will be indexed.
Step 2 — Get your MongoDB databases¶
Create a free account at MongoDB Atlas and create a cluster.
Under Database Access, add a username and password.
Under Network Access, add
0.0.0.0/0(allow from anywhere).Click Connect → Drivers and copy the connection string. It looks like:
mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/You need two — add a database name to the end of each, e.g.
/trackingand/storage1.
Beginner Tip
You can use the same cluster for both databases — just give them two different names at the end of the URL. The first is for tracking/metadata, the second stores your media references.
Step 3 — Create your config.env file¶
Clone the project and copy the sample config:
git clone https://github.com/weebzone/Telegram-Stremio
cd Telegram-Stremio
cp sample_config.env config.env
Open config.env and fill in these values:
Variable |
Required |
What it is |
|---|---|---|
|
✅ |
Telegram API ID (from my.telegram.org) |
|
✅ |
Telegram API Hash (from my.telegram.org) |
|
✅ |
Your bot token (from @BotFather) |
|
✅ |
Your numeric Telegram user ID |
|
✅ |
Two MongoDB URIs, separated by a comma |
|
✅ |
Web server port (keep |
|
⬜ |
Optional — only needed for Global Search |
A finished file looks like this (example values):
API_ID="1234567"
API_HASH="abc123def456ghi789jkl012mno345pq"
BOT_TOKEN="1234567890:AAEabcdEFGhijkLMnOPqrsTUVwxyz12345"
USER_SESSION_STRING=""
OWNER_ID="987654321"
DATABASE="mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/tracking,mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/storage1"
PORT="8000"
Common Mistake
The DATABASE value must contain exactly two connection strings separated by a
single comma, with no spaces around the comma.
Step 4 — Run the app¶
The easiest way is Docker Compose:
docker compose up -d
Your server is now running at http://<your-server-ip>:8000.
Good to Know
Prefer a free, always-online option with no server to manage? See the Hugging Face guide in Deployment.
Step 5 — Finish setup in the web panel¶
Open
http://<your-server-ip>:8000/loginin your browser.Log in with the default credentials —
admin/admin.Change the admin password immediately (Settings → Admin Authentication).
Fill in your TMDB API Key, Base URL, and AUTH_CHANNEL(s), then Save Settings.
See Configuration for what every field does.
Step 6 — Add your first file and watch it¶
Add your bot as an admin to your Telegram channel.
Make sure that channel is listed in AUTH_CHANNEL in the web settings.
Forward a movie with a good caption, e.g.
Ghosted 2023 720p WEBRip.mkv.In Telegram, send
/startto your bot — it replies with your addon URL.Paste that addon URL into Stremio/Nuvio.
Your movie now appears in the catalog. Press play. 🎉
Verify everything is working¶
Use this quick checklist:
The web panel loads at your URL and you can log in.
Settings shows a green/connected status for your databases.
Your bot replies to
/startwith an addon URL.A forwarded file appears under Media Management in the panel.
The title shows a poster and description (means TMDB/IMDb matching works).
The addon appears in Stremio and the file plays.
Stuck?
If a file doesn’t show up, the caption is almost always the reason. Jump to Media Management to learn the exact naming rules, or Troubleshooting for common fixes.