Deploying Discord bots reliably with Discloud’s manifest and CLI
Learn how to use a discloud.json manifest and the Discloud CLI to automate deployment, automatic restarts, and log streaming for your Discord bot.
08 Jul 2025, 06:23 UTC

Problem: Keeping a Discord bot online without manual restarts
When a Discord bot crashes, you often have to log into a server, pull the latest code, and restart the process manually. This interrupts service and requires you to be available at odd hours. A hosting platform that watches your Git repository, rebuilds on new commits, and restarts the bot automatically can remove that toil.
Thesis: Discloud’s manifest‑driven CLI automates deployment and recovery
Discloud provides a simple JSON manifest (discloud.json) that declares the entry point, start command, environment variables, and memory limit. Pairing that with its command‑line interface lets you link a repo, deploy, and stream logs—all while the platform handles automatic restarts after a crash.
Understanding the discloud.json manifest
The manifest lives at the root of your repository and tells Discloud how to run your bot. A minimal example looks like this:
{
"entry": "bot.js",
"start": "node bot.js",
"env": {
"BOT_TOKEN": ""
},
"memory": 256
}
Key fields:
entry– the file that Discloud will look for when starting the container.start– the command executed to launch the bot (you can use npm, yarn, or a direct node call).env– environment variables injected at runtime; keep secrets out of the manifest and repo by setting them through the Discloud dashboard instead.memory– RAM limit in megabytes; the platform will terminate the process if it exceeds this value.
If you prefer not to store the token in the file, omit it from env and add the variable via the dashboard’s “Secrets” section.
Deploying with the Discloud CLI
Assuming you have Node.js installed and a GitHub (or GitLab) repository ready, follow these steps in your local terminal:
- Install the CLI (once per machine):
npm install -g discloud-cli - Log in** to your Discloud account:
discloud login --email
You will be prompted for your password; after successful authentication the CLI stores a token locally. - Link your repository**
discloud link
Replacewith the HTTPS or SSH URL of your repo. The CLI will confirm the link and fetch the default branch. - Deploy**
discloud deploy
The CLI reads discloud.json, creates a build, and starts the container. On success you should see a line containing a deployment ID and the status “running”. - Stream logs** (optional but useful for debugging)
discloud logs -f
This follows the combined stdout/stderr of your bot; you can stop with Ctrl+C.
Where to run: any terminal with network access to Discloud’s API. Required permissions: a valid Discloud account (free tier suffices for testing) and push/pull access to the linked repository. Expected checks: after each command you should see a confirmation message (login success, link confirmation, deployment ID, log stream). Risks: placing secrets like your Discord bot token directly in discloud.json or committing them to the repository exposes them to anyone with repo access; prefer the dashboard’s secret store or CLI‑provided discloud env set if available.
Trade‑off / limitation
Discloud operates on a monthly credit system. The free tier provides a modest amount of compute time; if your bot runs continuously or uses more than the allotted memory, you will consume credits faster and may hit a pause until the next month or need to upgrade to a paid plan. Additionally, the platform is optimized for Discord bots—features like automatic restart and log streaming are tuned for that workload, and general‑purpose applications (e.g., web servers) may not benefit as much.
You can check your current credit balance and RAM usage in the Discloud dashboard under “Billing” or by running discloud account (if the CLI provides such a subcommand). If you see credits dropping quickly, consider lowering the memory value in discloud.json or optimizing your bot’s startup time.
Actionable closing
Start by creating a test repository with a simple echo bot, add a discloud.json that points to the script, and run the CLI steps above. Verify that the bot appears as “running” in the dashboard, that logs stream correctly, and that a deliberate crash (e.g., process.exit(1)) triggers an automatic restart within a few seconds. Once you confirm the workflow, move your real bot’s repo onto Discloud, set its secrets via the dashboard, and monitor credit consumption for the first week to decide whether the free tier meets your needs or if a paid plan is warranted.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.