Node.js

Free Node.js Discord bot hosting.

Upload your project, name your entry file, press start. discord.js and anything else you can install from npm, online around the clock.

Libraries

Libraries that run here

discord.js

The default choice, and what most tutorials you will find are written against. If you are starting from scratch, start here.

Sapphire

A framework built on top of discord.js. Command handling, argument parsing and plugins you would otherwise write yourself.

Anything on npm

There is no whitelist. If it installs from your package.json, it runs — database drivers, schedulers, HTTP clients, whatever your bot needs.

Deploying

Getting it running

  1. 1

    Upload your project

    Drag the folder into the file manager or push it over SFTP. Leave node_modules behind — it is installed for you, and uploading it wastes most of your 512 MB.

  2. 2

    Dependencies install themselves

    Your package.json is read on deploy and its dependencies are installed before your bot starts. Nothing to run by hand.

  3. 3

    Point us at your entry file

    Usually index.js. Your bot token goes into an environment variable rather than your source, so it never sits in a file you might share.

Memory

What actually fits in 256 MB

A discord.js bot serving a few hundred guilds sits comfortably inside 256 MB. The number that catches people out is not the code, it is the cache: discord.js keeps guild members in memory by default, and on large servers that grows faster than anything you wrote.

If you are close to the ceiling, narrowing your cache options and requesting only the intents you use will buy back more memory than any other change. What will not fit is a music bot — transcoding audio is memory-hungry and CPU-hungry at the same time, and 25% of a core is not the place for it.

FAQ

Questions

Do I need to upload node_modules?

No, and you should not. Upload your source and your package.json, and the dependencies are installed on deploy. A node_modules folder for a typical bot is larger than the 512 MB of disk you have to work with.

Can I write my bot in TypeScript?

Yes. Compile it to JavaScript before you upload and point us at the compiled entry file. What runs on the server is the JavaScript output, the same as it would be anywhere else.

Will 256 MB run a discord.js bot?

For a few hundred guilds, comfortably. discord.js is heavier than the raw gateway libraries because of what it caches for you, so if you are serving very large servers, watch your member cache before you blame the limit.

Can I host a music bot?

Realistically, no. Audio transcoding needs far more memory and CPU than a free tier can give you, and we would rather say so here than let you find out after setup.

Free tools for Discord bots