Overview
Discord bots need a process that stays online, stable network access to Discord’s API, and a place to store your code and configuration. Shard hosting gives you a dedicated environment so your bot can respond to commands and events without relying on your laptop.
Before you deploy
- Create a Discord application and bot in the Developer Portal and copy the bot token securely.
- Enable required intents (e.g. message content, members) in the portal if your library needs them.
- Use environment variables or a secrets file on the server—never commit tokens to public repos.
Runtime and dependencies
Discord bots are commonly built with Node.js (discord.js), Python (discord.py), or other languages. Match your Node or Python version to what your framework supports, then install dependencies with your package manager. Keep dependencies updated for security patches.
Process management
Use a process manager (PM2, systemd, or similar) so your bot restarts after crashes or reboots. Configure log rotation so you can trace errors without filling the disk.
Common issues
- Invalid token: Regenerate the token in the portal if the bot was reset or leaked.
- Privileged intents: If commands fail silently, check intents in the Developer Portal.
- Rate limits: Back off requests and avoid tight loops when calling Discord’s API.
Need more help?
Open a ticket from your Shard dashboard or contact support with your bot’s language, framework version, and a short error log snippet.