Bun
Free Bun Discord bot hosting.
Your discord.js bot on a faster runtime, with TypeScript that runs without compiling it first. Upload, name your entry file, press start.
Libraries
Libraries that run here
discord.js
Runs under Bun from the same package.json. It is written for Node and tested there first, so a bug that only shows up here is worth checking against Node before you report it upstream.
Optional native add-ons
Packages such as zlib-sync and bufferutil are optional speed-ups for discord.js, and they are the part most likely to fail to build under Bun. Leave them out; discord.js works without them.
Anything on npm
bun install reads the same package.json Node does. Pure JavaScript packages behave the same; native add-ons are where the differences show up.
Deploying
Getting it running
- 1
Upload your project
Drag the folder into the file manager or push it over SFTP, and leave node_modules behind. Bun installs it on deploy, and a local copy is the quickest way to spend your 512 MB of disk.
- 2
bun install runs for you
Your package.json is installed before the bot starts. It is the same file a Node project uses, so moving a bot between the two runtimes needs no changes to it.
- 3
Point us at your entry file
index.ts is fine as it is, because Bun runs TypeScript directly. Your token goes into an environment variable and is read from process.env, exactly as it would be under Node.
Memory
What actually fits in 256 MB
A discord.js bot on Bun lands where it does on Node: comfortable in 256 MB for a few hundred guilds. The runtime is not where the memory goes. discord.js caches guild members by default, and on large servers that cache outgrows everything you wrote, whichever engine is running it.
Narrow the cache and request only the intents you use before blaming the limit. Running TypeScript directly adds nothing to watch either: Bun transpiles each file as it loads, so there is no compiler process sitting in memory beside your bot. A music bot will not fit here on any runtime.
FAQ
Questions
Why pick Bun over Node.js?
Faster startup, TypeScript without a build step, and a quicker install. For a bot that runs all day, the startup difference mostly shows when it restarts. If none of that appeals, Node.js is the conservative choice and you lose nothing by taking it.
Do I need to compile my TypeScript?
No. Point us at the .ts entry file and Bun runs it. Bun strips the types rather than checking them, so run tsc on your own machine if you want type errors caught before you deploy.
What if a package does not work under Bun?
Node.js is the fallback. The same package.json and the same code run there unchanged, unless you have reached for a Bun-only API such as Bun.file, and discord.js is at home on either.
Can I host a music bot on Bun?
No, on Bun or anything else here. Audio transcoding wants far more memory and CPU than a free allocation has, and a faster runtime does not change that.
More on Discord bots
Hosting something else?
Control it from code
Free tools for Discord bots