Black Friday: first month free on quarterly plans · until 30 Nov See the plans Conditions
New here? Try a Minecraft server or Discord bot free for 24 hours. Try free
ServerSparkServerSpark

Knowledge base

Run your Discord bot 24/7

Upload and start your Node.js or Python Discord bot and keep it online 24/7, with automatic package installs and restarts.

NVMe nodesNightly backupsOnline in minutes

Updated 30 October 2026

With a Discord bot hosting plan, your bot runs 24/7, even when your PC is off. This guide works for Node.js (discord.js) and Python (discord.py).

1. Store your token safely

Your bot token is a password. Never put it in a public GitHub repository. Create a .env file on the server containing:

DISCORD_TOKEN=your-token-here

Read it in your code with process.env.DISCORD_TOKEN (Node.js, using the dotenv package) or os.getenv("DISCORD_TOKEN") (Python, using python-dotenv).

2. Upload your code

  • Upload files: in SparkPanel, go to Files and upload your files (or use SFTP).
  • From Git: want your bot to pull its code from a (private) Git repository? Email us the link and we'll set it up. Then set Auto Update to 1 under Settings: every restart pulls the latest version automatically.

3. Set the startup file

Under Settings, check which file is started:

  • Node.js: index.js by default. Packages from package.json are installed automatically on start.
  • Python: app.py by default. Packages from requirements.txt are installed automatically.

If your file has a different name, change it there.

4. Start

Click Start in SparkPanel. The console shows your bot's output, including any error messages.