TypeScript Discord Bot Hosting
TypeScript bots run straight from your .ts files. Bun runs them natively, or you can choose ts-node on Node 20 or 22. There is no separate compile step to set up.
Dependencies install from package.json on every start, and Git deploy pulls your latest commit on each restart.
- Runtimes
- Bun 1, or ts-node on Node 20 or 22
- Entry file
- index.ts (you can change it)
- Dependencies
- bun install or npm install on every start
- Deploy
- Upload, or Git with pull on restart
A bot that runs here as it is
A minimal discord.js bot in TypeScript. On Bun this runs as it is.
import { Client, Events, GatewayIntentBits } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once(Events.ClientReady, (c) => {
console.log(`Ready as ${c.user.tag}`);
});
client.login(process.env.DISCORD_TOKEN);How to host a TypeScript Discord bot on Zeros Host
- 1
Create the bot in the Discord Developer Portal
Go to discord.com/developers/applications, create an application, open the Bot tab and press Reset Token to copy your token. Under OAuth2, pick the bot and applications.commands scopes, choose the permissions your bot needs, and open the generated link to add the bot to your server.
- 2
Create a TypeScript bot server
Start a free trial or pick a Discord Bot plan and choose TypeScript. Bun is the default runtime. To run on Node instead, set TS Runtime to ts-node and pick one of the Node images on the Startup page.
- 3
Add your bot token
Open the Startup page for your server and paste your token into Discord Token. The panel passes it to your bot as the DISCORD_TOKEN environment variable, so it never has to sit inside your code or your Git repository.
- 4
Upload your project or connect Git
Upload index.ts and package.json, or set Git Repository on the Startup page and reinstall. If your entry file lives elsewhere, set Bot Main File to its path, such as src/index.ts.
- 5
Start it
Press Start. The console shows the install, then your ready message once the bot connects.
Common TypeScript bot errors and fixes
Cannot find module or its type declarations
The package is missing from package.json. Add it under dependencies and restart so the install picks it up.
Code works on Node locally but not on Bun
A few Node specific packages behave differently on Bun. Set TS Runtime to ts-node and pick a Node image on the Startup page to run on Node instead.
The bot logs in but slash commands never appear
Slash commands have to be registered with Discord. Register them once per guild for instant updates while you build, or globally when you are done (global commands can take a while to show). Make sure the invite link included the applications.commands scope.
Used disallowed intents
Your code asks for a privileged intent (Message Content, Server Members or Presence) that is switched off for your bot. Turn it on under Bot, Privileged Gateway Intents in the Developer Portal, or remove it from your code.
An invalid token was provided
The token in Discord Token is wrong or was reset. Reset it in the Developer Portal, paste the new one on the Startup page and restart. Discord also resets tokens it finds in public GitHub repositories, so keep yours out of your code.
Which plan fits
TypeScript bots use about the same memory as their JavaScript twins. Standard at 512 MB suits most of them.
Starter
£1/mo
256 MB RAM · 5 GB
Standard
£3/mo
512 MB RAM · 10 GB
Suggested for this bot
Pro
£5/mo
1 GB RAM · 15 GB
Enterprise
£6/mo
2 GB RAM · 25 GB
Try it free for 48 hours
Start a 48-hour Discord bot trial with no card needed. Pick your runtime and your server is ready in seconds. Plans start at £1 a month after that.
Frequently asked questions
Do I need to compile with tsc first?
No. Bun runs TypeScript directly, and the ts-node option runs it on Node. You can still compile yourself and run the JavaScript on a Node.js server if you prefer.
Which runtime should I pick?
Bun starts fast and needs no extra setup, so it is the default. Choose ts-node if your bot depends on packages that expect Node.