Why move
Your PC sleeps, reboots for updates, and drops Wi-Fi. Each of those takes the bot offline (common causes). A host keeps the process running in a data center and restarts it if it crashes.
Step by step
- List dependencies. Node:
package.jsonand lockfile. Python:pip freeze > requirements.txt, then trim it. Java: build a fat jar. - Remove secrets from code. Swap the hard-coded token for
process.env.BOT_TOKEN/os.environ["BOT_TOKEN"]. Do the same for API keys. - Fix paths. Swap
C:\Users\...for relative paths such as./data/db.sqlite. - Bring your data. Include SQLite or JSON data files in the upload. If they change a lot, think about a hosted database (discordbothost Pro includes 1).
- Upload and configure. Create the server from the discord.js, discord.py or JDA template. Upload a zip or use SFTP (or a public GitHub repo on Free and paid plans), set the environment variables, and press Start.
- Switch off the PC copy. Two running copies with the same token both answer commands, so stop the local one once the hosted bot shows "logged in".
Checklist after moving
- The console shows your ready or "logged in" line.
- A slash command works in your test server.
- The memory graph stays well under the plan limit.
- Free plan: you know your renewal day. discordbothost reminds you 48 and 24 hours before.
Why discordbothost for your first move
- A free 256 MB plan with no idle sleep. Renew once a week.
- Templates for the three big libraries, so there's nothing to install.
- File manager and SFTP for uploads, plus a live console.
- Upgrade to Starter ($0.99/month, 512 MB) for no renewal, backup slots when available and push-to-deploy.
Backups are available: manual on Free, daily and manual on paid plans.
Questions
Can I keep my Discord bot running when my PC is off?
Not on the PC itself. Move the bot to a host or server; it then runs independently of your computer.
Will my bot's data move with it?
Only what you upload. Copy any local database files (like SQLite) and config with the code, or move data into a hosted database.
Do I need to change my code to move hosts?
Usually only how the token and paths are read: use environment variables for secrets and relative paths for files.
Sources
Related
Why Does My Discord Bot Keep Going Offline?
7 common reasons a Discord bot goes offline (PC sleep, sleeping free hosts, crashes, memory, bad token, intents, rate limits) and how to fix each.
Updated · 4 min readRender Discord Bot Hosting: Free Limits and Setup
Can Render host a Discord bot? Choose a worker or HTTP service, understand free sleep limits, set build commands and move your bot safely.
Updated · 4 min readHow to Host a Discord Bot for Free (Step by Step)
Host a Discord bot 24/7 for free: create the bot, upload your discord.js, discord.py or JDA code to a free host, set the token, and keep it renewed.
Updated · 3 min read