ACLClouds
ACLClouds

Host a Discord bot for free: Python and Node.js tutorial

Create the bot, copy the token, pick discord.py or discord.js, upload the code and read the logs: the steps to run a Discord bot 24/7 without paying.

To host a Discord bot for free and 24/7, create the bot in the Discord Developer Portal, copy its token, then deploy your discord.py or discord.js code to a host that keeps it running for you. At ACLClouds, the Free plan runs a bot without a credit card, with 315 MB of RAM and a free renewal every 4 days. Here is every step, from creating the bot to the first /hello command.

  • The token can be copied only once, in the Bot tab of the Discord Developer Portal.
  • The code reads the token from the DISCORD_TOKEN variable, never hard-coded in a file.
  • The ACLClouds Free plan hosts 1 Node.js or Python bot with 315 MB of RAM, without a credit card.
  • Renewal is free every 4 days, from the bot's page.

Create the bot on Discord

Open the Discord Developer Portal, create an application, then open the Bot tab. Click Reset Token and copy the token: Discord shows it only once. In the OAuth2 tab, tick the bot and applications.commands scopes, generate the invite link and add the bot to your server.

  • The token gives full access to the bot: never publish it, in code or in a screenshot.
  • Enable Message Content Intent only if the bot reads message text (prefix commands).
  • Slash commands such as /hello do not need this intent.

Choose Python or Node.js

When you order the Free plan, choose the Node.js environment for discord.js or Python for discord.py. The bot starts with a sample project that answers /hello, so you can check that everything works before uploading your own code. You can change the version later in the panel: Node.js 20, 22 or 24, Python 3.11, 3.12 or 3.13.

  • Node.js: a package.json with discord.js in the dependencies and a start script.
  • Python: a requirements.txt with discord.py and the main file, for example bot.py.
  • Detailed guides: create a Node.js bot and host a Python bot.

Keep the token out of the code

Your code reads the token from the DISCORD_TOKEN environment variable: process.env.DISCORD_TOKEN in Node.js, os.environ["DISCORD_TOKEN"] in Python. If the variable is empty, the bot console shows a "Bot token" card: paste the token there, it is saved and the bot restarts. You can also enter it in the Startup tab.

  • A value that looks like the application ID or the client secret is flagged before it is saved.
  • A token pasted by mistake into a variable name field is rejected.
  • More details in the guide to storing tokens and secret variables.

Upload your code

Replace the sample project with your own from the Files tab or over SFTP. Each bot has its own SFTP access, shown in the Settings tab: host, port 2222, username and password, to enter in FileZilla or WinSCP with the SFTP protocol.

  • Do not upload node_modules or .venv: dependencies are installed on the server.
  • A single upload can be up to 100 MB on the Free plan.
  • If the start file cannot be found, the console searches the sub-folders and offers to fix the path in one click.

Start the bot and read the logs

Start the bot from the console. With the sample project, the line "Logged in as" followed by the bot's name confirms it is connected to Discord. Then type /hello on your server: a global command can take a few minutes to appear the first time. If something fails, read the first error line in the console, not the last one.

  • Cannot find module or ModuleNotFoundError: a dependency is missing from package.json or requirements.txt.
  • A bot that stops unexpectedly restarts automatically, and the logs stay available.
  • Bot connected but silent: read why a Discord bot goes offline.

Why choose ACLClouds for this bot

The Free plan does not put the bot to sleep and does not ask for a credit card. Its limits are public: 1 bot, 315 MB of RAM, 0.25 vCPU and 715 MB of storage. Renewal is free, from the bot's page, during the 2 days before the due date.

  • SFTP access for each bot (port 2222), free plan included.
  • ffmpeg, yt-dlp and deno preinstalled in the Node.js and Python environments.
  • A panel in 7 languages, including English, French and German.
  • A paid plan later, on the same panel, when the bot needs more resources or a database.

Frequently asked questions

Does my bot stay online when my PC is off?

Yes. The bot runs on ACLClouds infrastructure, not on your computer. You just renew the Free plan for free every 4 days from the bot's page.

What happens if I forget to renew?

The bot is suspended on the due date. Once suspended, you can renew it for free from its page, then restart it.

Can I host a music bot on the Free plan?

ffmpeg and yt-dlp are preinstalled, but audio playback uses memory and CPU. With 315 MB of RAM and 0.25 vCPU, test on a small server, then move to a paid plan if the sound cuts out.

How many bots can I host for free?

One bot per account on the Free plan. A second bot needs a paid plan, starting with the Starter plan.