This guide is designed for users who want to set up TG-Spam but don't have technical experience. We'll walk through the process step by step in plain language.
- A computer running Windows, Mac, or Linux
- A Telegram account
- Admin rights in the Telegram group you want to protect
- About 15-20 minutes of your time
First, we need to create a bot with Telegram:
- Open Telegram and search for "@BotFather"
- Click "Start" to begin chatting with BotFather
- Type
/newbot
and send it - BotFather will ask for a name for your bot. Type any name you like (e.g., "My Group's Spam Protector")
- Next, create a username for your bot. It must end in "bot" (e.g., "mygroupspambot" or "my_group_spam_bot")
- BotFather will give you a token - it looks like a long string of numbers and letters. Save this token somewhere safe - you'll need it later!
Remember: Never share your bot token with anyone - it's like a password for your bot!
Please note: using an instance, droplet, virtual machine, VPS, or whatever it is called within the provider of your choice with preinstalled Docker and Docker Compose is usually a better and simpler choice. In this case, you can skip this step. To make sure you have Docker installed, run docker --version
and docker compose --version
in your terminal.
See the official Docker Desktop documentation for more detailed instructions.
Docker Desktop is a program that helps run TG-Spam on your computer. Here's how to install it:
- Go to Docker Desktop for Windows
- Click the "Download for Windows" button
- Once downloaded, double-click the installer
- Follow the installation wizard, keeping all default settings
- Restart your computer when asked
- Go to Docker Desktop for Mac
- Click the "Download for Mac" button
- Once downloaded, drag Docker to your Applications folder
- Double-click Docker in Applications to start it
- Follow any prompts that appear
See the official docs for more detailed instructions.
- Open Terminal
- Copy and paste these commands one at a time:
For Ubuntu/Debian:
# Update your system
sudo apt update
sudo apt upgrade
# Install required packages
sudo apt install curl
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add your user to docker group (so you don't need sudo for docker commands)
sudo usermod -aG docker $USER
# Start Docker
sudo systemctl start docker
sudo systemctl enable docker
For Fedora:
# Install required packages
sudo dnf -y install dnf-plugins-core
# Add Docker repository
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
# Install Docker
sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add your user to docker group
sudo usermod -aG docker $USER
# Start Docker
sudo systemctl start docker
sudo systemctl enable docker
- Log out and log back in for the group changes to take effect
- Test Docker by running:
docker --version
- Create a new folder on your computer called "tg-spam"
- Inside this folder, create a new text file named
docker-compose.yml
- Copy and paste this template into the file:
services:
tg-spam:
image: umputun/tg-spam:latest
restart: always
environment:
- TELEGRAM_TOKEN=YOUR_BOT_TOKEN_HERE
- TELEGRAM_GROUP=YOUR_GROUP_NAME_HERE
volumes:
- ./data:/srv/data
- Replace
YOUR_BOT_TOKEN_HERE
with the token you got from BotFather - Replace
YOUR_GROUP_NAME_HERE
with your Telegram group's username (without the @ symbol)
- Open Terminal (Mac and Linux) or Command Prompt (Windows)
- Type
cd
(with a space after cd) and drag your tg-spam folder into the window - Press Enter
- Type this command and press Enter:
docker-compose up -d
- Go to your Telegram group
- Click the group name at the top
- Click "Add members" or "Add"
- Search for your bot using the username you created
- Add the bot
- Make the bot an admin:
- Click the group name again
- Click "Administrators" or "Manage group"
- Click "Add Admin"
- Find your bot and select it
- Enable all permissions except "Anonymous"
- Click "Done" or "Save"
Q: How do I know if it's working? A: The bot will automatically start monitoring messages. Try sending a test message in your group - the bot should be active and monitoring.
Q: How do I stop the bot?
A: In Terminal/Command Prompt, go to your tg-spam folder and type: docker-compose down
Q: How do I update the bot? A: In Terminal/Command Prompt, go to your tg-spam folder and type:
docker-compose pull
docker-compose up -d
Q: Something's not working. What should I check?
- Make sure Docker Desktop is running
- Verify your bot token is correct
- Confirm the bot has admin rights in your group
- Check that your group name is entered correctly in the configuration