Bots & workers

    Deploy Discord bot on Oracle Cloud's free tier

    An always-on bot process with no sleeping dyno, no idle timeout and no monthly bill.

    At a glance

    Base imagenode:22-alpine
    Port3000
    Build commandnpm ci --omit=dev
    Start commandnode index.js
    Infrastructure cost$0 on Oracle Always Free (platform fee for managed DevOps)

    Running Discord bot on Ampere ARM

    A discord.js gateway connection uses well under 200 MB of RAM, so a single Always Free ARM instance can host several bots at once.

    Steps

    1. Store the token as a secret. Never commit the bot token. Add it in project settings as DISCORD_TOKEN.
    2. Add a tiny HTTP health server. Bots have no web port by default; a 20-line server lets deploys verify the process is alive.
      require("http").createServer((_, res) => res.end("ok")).listen(3000);
    3. Deploy and enable auto-restart. The container restarts on crash and on VM reboot.

    Dockerfile for Discord bot on ARM64

    FROM node:22-alpine
    WORKDIR /app
    ENV NODE_ENV=production
    COPY package*.json ./
    RUN npm ci --omit=dev
    COPY . .
    CMD ["node", "index.js"]

    Need one tailored to your repository? The free Dockerfile generator writes an ARM-ready multi-stage build for you.

    Common mistakes

    • Rate limits after redeploys: Re-registering slash commands on every boot will hit Discord's limits. Register them from a separate script.
    • Missing gateway intents: Message content requires a privileged intent enabled in the Discord developer portal.
    • Losing state on redeploy: Keep persistent data in Postgres or a mounted volume, not in memory.

    Related reading

    Get the Oracle Always Free deploy checklist

    One email with the exact steps, capacity workarounds and tools we use to ship apps for $0 of cloud spend.

    One email, no spam. Unsubscribe anytime.

    Frequently asked

    Will the bot go offline?+

    Only if the VM does. There is no idle timeout on an Always Free instance, which is the main reason people move bots off free PaaS tiers.

    Can I host a Python bot?+

    Yes — swap the base image for python:3.12-slim and run discord.py the same way.

    How many bots per instance?+

    Several. Run each as its own container and give them memory limits.

    Deploy your project for $0

    No credit card. No Oracle sales call. Ship to your own cloud in under 10 minutes.

    Start free