Deploy your first Discord bot
From an empty folder to a bot that is online 24/7.
This guide walks you through hosting a discord.js bot on DIGITALYCloud. It takes about five minutes and works on the Free plan.
1. Prerequisites
You need a bot token from the Discord Developer Portal and a project with a package.json.
import { Client, GatewayIntentBits } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.login(process.env.DISCORD_TOKEN);{
"name": "syncbot",
"type": "module",
"scripts": { "start": "node index.js" },
"dependencies": { "discord.js": "^14.16.0" }
}2. Create the service
In the dashboard, click + New Service, choose Discord Bot, then connect your GitHub repository.
GitHub
Auto-deploy on push
Upload files
Drop a .zip archive
Docker Image
Any public image
3. Add your token
In the configuration step, add an environment variable named DISCORD_TOKEN. It is encrypted and only injected at runtime.
4. Deploy
Click Deploy Service. DIGITALYCloud installs dependencies, runs npm start and checks that the process stays alive.
[21:14:02] Starting SyncBot...
[21:14:03] Loading environment variables...
[21:14:04] Connecting to Discord...
[21:14:05] Logged in successfully
[21:14:05] Bot is now onlineDashboard preview
SyncBot
Discord Bot · France — Lyon
CPU
2.4%
RAM
186 MB
Uptime
14d 08h
main without opening the dashboard.