π ππππππ ππ ππππππ π πππππ πππ
βοΈ Thanks to everyone for using ππππππ π πππππ!
- Requirements / Prerequisites
- Deploy on Render (1-Click & Free)
- Deploy on VPS (Step by Step - Recommended)
- Deploy on Heroku
- Environment Variables (.env)
- Support & Community
Before deploying, make sure you have:
- API_ID & API_HASH β Obtain from my.telegram.org.
- BOT_TOKEN β Obtain from @BotFather.
- MONGO_DB_URI β MongoDB database connection string from MongoDB Atlas.
- STRING_SESSION β Pyrogram v2 String Session (generate using string generator bot or script).
- OWNER_ID β Your Telegram User ID (get from @MissRose_bot using
/id). - LOGGER_ID β Telegram Group/Channel ID (with
-100...) where bot logs events.
You can easily deploy Hacker-X-Music to Render in 1-Click:
- Click the Deploy to Render button above (or open dashboard.render.com).
- Sign in or create a Render account.
- Fill in your environment variables (
API_ID,API_HASH,BOT_TOKEN,OWNER_ID,MONGO_DB_URI,LOGGER_ID,STRING_SESSION). - Click Apply / Create Web Service.
- Render will automatically build the Docker container and start your bot!
Tip
Keep Render 24/7 Alive (No Sleep Mode): Render free web services go to sleep after 15 minutes of inactivity. To keep your bot running 24/7:
- Copy your Render web service URL (e.g.,
https://hacker-x-music.onrender.com). - Open UptimeRobot.com (Free).
- Add a new HTTP(s) monitor pointing to your Render URL with a 5-minute interval.
Open your terminal (PuTTY / SSH) and run:
sudo apt update && sudo apt upgrade -ysudo apt install git python3 python3-pip ffmpeg screen -ygit clone https://github.com/bindplant123/Hacker-X-Music.git
cd Hacker-X-Musicpip3 install -U pip
pip3 install -U -r requirements.txtCreate and edit your .env file:
cp sample.env .env
nano .envFill in your details:
API_ID=1234567
API_HASH=your_api_hash_here
BOT_TOKEN=your_bot_token_here
LOGGER_ID=-1001234567890
MONGO_DB_URI=your_mongodb_connection_string
OWNER_ID=your_telegram_id
STRING_SESSION=your_pyrogram_string_sessionTip: Save and exit
nanoby pressingCTRL + O, thenEnter, thenCTRL + X.
Create a new screen session:
screen -S musicbotStart the bot inside the screen:
python3 -m AnonXMusic- To Detach screen (keep running in background): Press
CTRL + AthenD. - To Reattach screen (check live logs): Run
screen -r musicbot. - To Stop the bot: Inside screen, press
CTRL + C.
- Update and install git:
sudo apt update && sudo apt install git screen -y - Clone & run installer:
git clone https://github.com/bindplant123/Hacker-X-Music.git cd Hacker-X-Music bash setup - Enter your
API_ID,API_HASH,BOT_TOKEN,OWNER_ID,MONGO_DB_URI,LOGGER_ID, andSTRING_SESSIONwhen prompted. - Run the bot:
(Press
screen -S musicbot bash start
CTRL + AthenDto detach)
To ensure your bot restarts automatically if VPS reboots or if it crashes:
- Create a systemd service file:
sudo nano /etc/systemd/system/musicbot.service
- Paste the following configuration:
[Unit] Description=Hacker-X-Music Telegram Bot After=network.target [Service] Type=simple User=root WorkingDirectory=/root/Hacker-X-Music ExecStart=/usr/bin/python3 -m AnonXMusic Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
- Reload daemon and start service:
sudo systemctl daemon-reload sudo systemctl enable musicbot sudo systemctl start musicbot - Service Management Commands:
- Check status / logs:
sudo systemctl status musicbot - Restart bot:
sudo systemctl restart musicbot - Stop bot:
sudo systemctl stop musicbot - View live logs:
journalctl -u musicbot -f
- Check status / logs:
- Install Docker:
sudo apt update && sudo apt install docker.io -y - Clone repository and configure
.env:git clone https://github.com/bindplant123/Hacker-X-Music.git cd Hacker-X-Music cp sample.env .env nano .env - Build and Run Docker Container:
docker build -t hacker-x-music . docker run -d --name musicbot --restart always --env-file .env hacker-x-music - Manage Docker Container:
- View logs:
docker logs -f musicbot - Restart:
docker restart musicbot - Stop:
docker stop musicbot
- View logs:
| Variable | Description | Mandatory |
|---|---|---|
API_ID |
Telegram API ID from my.telegram.org | Yes |
API_HASH |
Telegram API HASH from my.telegram.org | Yes |
BOT_TOKEN |
Bot token from @BotFather | Yes |
OWNER_ID |
Telegram user ID of bot owner | Yes |
MONGO_DB_URI |
MongoDB database URI string | Yes |
LOGGER_ID |
Log channel/group ID (starts with -100) |
Yes |
STRING_SESSION |
Pyrogram v2 string session for assistant account | Yes |
COOKIES_DIR |
Directory containing cookies*.txt pool (Default: .) |
No |
YOUTUBE_API_KEY |
Google Cloud YouTube Data API v3 key (Faster search) | No |
