Running your Discord bot 24/7 on your PC isn’t ideal, that’s where a VPS (Virtual Private Server) comes in! With a VPS, your bot stays online all the time. In this quick guide, you’ll learn how to:
Let’s get started 🚀
When you buy a VPS (from providers like DigitalOcean, Linode, or AWS), you’ll get:
root)To connect, open your terminal and run:
ssh root@YOUR_SERVER_IPEnter the password when asked. You’re now inside your VPS 🎉.
Most Discord bots are made in Python. Install it on your VPS:
apt update && apt install -y python3 python3-pipThere are two common ways:
scp -r ./my-bot root@YOUR_SERVER_IP:/home/root/This copies your bot folder to the VPS.
git clone https://github.com/yourusername/your-bot.git
cd your-botInside your bot folder, install dependencies (like discord.py):
pip3 install -r requirements.txtpython3 bot.pyIf everything works, your bot should come online 🎊.
If you close your SSH session, the bot will stop. To keep it running, use nohup:
nohup python3 bot.py &Now it will continue running in the background
You’ve successfully hosted your Discord bot on a VPS using SSH! Your bot is now online 24/7 without needing your PC.