Deploy guide Frankfurt, Germany

Deploy Discord bot on Nodion

A Discord bot keeps a connection open instead of answering HTTP requests, so on Nodion it runs as a worker process without a port. Add one Procfile line and one process, keep the token in a secret variable, and the bot runs around the clock in Frankfurt. Telegram bots with long polling work the same way.

Deploy to Nodion ›

from 1 EUR / month

Up to 15 € credit when signing up

Runs as
worker process, no port
Start
worker: python bot.py or worker: node bot.js
Libraries
discord.py, discord.js, python-telegram-bot
Region
EU Central (Frankfurt)

Deploy Discord bot step by step

  1. Read the token from the environment Never commit the bot token. Read it from an environment variable, here with discord.py; with discord.js it is client.login(process.env.DISCORD_TOKEN). bot.py
    import os
    
    import discord
    
    intents = discord.Intents.default()
    client = discord.Client(intents=intents)
    
    
    @client.event
    async def on_ready():
        print(f"Logged in as {client.user}")
    
    
    client.run(os.environ["DISCORD_TOKEN"])
  2. Add a Procfile with a worker line A Python bot needs a requirements.txt with discord.py. A Node.js bot uses worker: node bot.js, discord.js in package.json and a committed lockfile; for a TypeScript bot with a build step, a Dockerfile is the simpler route. Leave out a web: line: the bot has no web server. Procfile
    worker: python bot.py
  3. Create the app and store the token Create an application from your GitHub, GitLab, Bitbucket or Gitea repository in the region EU Central. On the Environment tab, add DISCORD_TOKEN and mark it as secret: after saving, the value can no longer be read back.
  4. Add the worker process and turn off web Procfile lines do not create processes by themselves. On the Processes tab, add a process named worker without a port and with an empty command, so it runs the Procfile entry of that name. Then set web to 0 instances or delete it: a bot never answers the HTTP health check that web needs.
  5. Deploy again If the first deploy ran before you added the worker, deploy again. The worker counts as running as soon as it starts, without an HTTP check, and the runtime logs show the bot logging in.

Good to know

  • A fresh instance once a dayProcesses keep running and do not sleep. On every deploy and about once a day, Nodion replaces each instance with a fresh one: the new one starts before the old one gets SIGTERM. Your bot has to connect cleanly when it starts, and for a short moment both copies can be online. With a local volume attached, there is no daily replacement, and on a deploy the old instance stops before the new one starts.
  • Keep one instanceRun the worker with one instance. Two copies of a bot answer every message twice, and Telegram allows only one long-polling connection per token.
  • Store data outside the instanceFiles the bot writes, such as a SQLite database, are gone with the next fresh instance. Keep state in PostgreSQL or Valkey in the same region, or on a volume.
  • Webhook botsBots that receive webhooks, such as Telegram bots in webhook mode or Discord bots with an interactions endpoint URL, are normal web apps: they run as web, listen on PORT and answer the health check path with 2xx or 3xx.

What Nodion runs for you

  • Deploys without downtime Push to your branch and Nodion builds a new release. Traffic switches once the new instances answer their health check; a failed release leaves the running one in place. Apps with a local volume restart instead, because the disk belongs to one instance.
  • Databases next to the app Managed PostgreSQL, pgvector, MySQL, Valkey and ClickHouse in the same region. Attached databases arrive as DATABASE_URL, REDIS_URL or CLICKHOUSE_URL.
  • Previews per pull request Turn on previews and pull requests from your repository get their own app with its own URL and fresh, empty databases, created automatically or by hand. Forks and bot pull requests are skipped.
  • Workers, cron jobs and scaling Run workers as extra processes of the same app, schedule jobs on the Cron tab, and scale every process to up to 16 instances.
  • Release step With buildpacks, a Procfile release: line runs with every new build. Dockerfile apps, and redeploys or rollbacks to an earlier image, use a release command set on the app itself, which also takes precedence over the Procfile line. On static sites a release step runs in an image that holds only the built files.
  • Logs and metrics Build, release and runtime logs plus CPU, memory, disk and network metrics for every instance in the dashboard.
  • Domains and HTTPS A default hostname with HTTPS from the first deploy; your own domains get certificates automatically.

Discord bot on Nodion: questions and answers

Does my bot go to sleep?

No. A process runs until you scale it to 0 instances or delete it. About once a day it is replaced with a fresh instance (not with a local volume attached), so make sure the bot reconnects on start.

Can I host a Telegram bot the same way?

Yes. A bot with long polling, for example python-telegram-bot with run_polling(), runs as a worker exactly like a Discord bot, with its token in a secret variable. A bot in webhook mode is a normal web app instead.

Why does the first deploy of my bot fail?

The bot ran as the web process, which waits for an HTTP answer that never comes; after 10 minutes the release is aborted. Add the worker process, set web to 0 instances and deploy again.

Where does my Discord bot app run?

In the EU Central region in Frankfurt, Germany. Build, registry, the app and its databases, volumes, buckets, logs and metrics stay in that region, and Nodion's API and control plane are hosted in Germany. Nodion GmbH is based in Stuttgart.

Can I use Discord bot in line with the GDPR?

Nodion provides the basis for it: Nodion GmbH is based in Stuttgart, Germany, in the Frankfurt region the app, its databases and volumes run in Germany, and you conclude the data processing agreement (DPA) under Art. 28 GDPR electronically in the dashboard. Whether your setup complies also depends on how you configure and use the app.

How much does it cost to run Discord bot on Nodion?

An app instance starts at 1 EUR per month. The setup in the cost box costs 1 EUR per month: App 1 EUR. Prices are net and billed per second, and you pick bigger sizes or more instances whenever you need them.

Can I use my own domain for my Discord bot app?

Yes. Every app gets a default hostname with HTTPS. Add your own domain on the app's Domains tab; the TLS certificate is issued and renewed automatically.

Give your agent a cloud.

Earn up to 15 € in credit when signing up.

Continue with GitHub

or with email

Stay in the loop.

Product news, no spam. Unsubscribe anytime.