HomeStart / GuidesAnleitungen / How to run a Discord bot 24/7 on a VPS/ Wie man einen Discord-Bot rund um die Uhr auf einem VPS betreibt

How to run a Discord bot 24/7 on a VPSWie man einen Discord-Bot rund um die Uhr auf einem VPS betreibt

A continuously available Discord bot needs a supported runtime, durable configuration, monitored restarts and a clear network boundary. This guide shows the operating pattern without assuming a particular public hosting plan.Ein dauerhaft verfügbarer Discord-Bot benötigt eine unterstützte Laufzeit, beständige Konfiguration, überwachte Neustarts und eine klare Netzwerkgrenze. Diese Anleitung zeigt das Betriebsmuster, ohne einen bestimmten öffentlichen Hosting-Tarif vorauszusetzen.

Why a VPS (not free hosting)Warum ein VPS (kein kostenloses Hosting)

A dedicated execution environment can provide predictable runtime and restart control. Confirm operating system, resources, access, outbound connectivity, any required inbound endpoint, support and total price before choosing a host.Eine eigene Ausführungsumgebung kann eine planbare Laufzeit und Neustartkontrolle bieten. Bestätige Betriebssystem, Ressourcen, Zugang, ausgehende Verbindung, einen möglicherweise benötigten eingehenden Endpunkt, Support und Endpreis vor der Host-Wahl.

How much VPS do you need?Wie viel VPS brauchst du?

Resource use depends on language, libraries, caches, guild and event volume, media work and external integrations. Measure the real process with headroom. A gateway-based bot normally opens outbound connections; a public webhook or dashboard additionally needs a confirmed inbound path.Der Ressourcenbedarf hängt von Sprache, Bibliotheken, Caches, Guild- und Ereignisvolumen, Medienarbeit und externen Integrationen ab. Miss den echten Prozess mit Reserve. Ein Gateway-basierter Bot öffnet normalerweise ausgehende Verbindungen; ein öffentlicher Webhook oder ein Dashboard benötigt zusätzlich einen bestätigten eingehenden Weg.

Step 1, Get your VPS & basicsSchritt 1, VPS & Grundlagen holen

  1. Use a host or accepted offer that confirms the runtime, resources, operating system, outbound network, access and restart method.Nutze einen Host oder ein angenommenes Angebot, das Runtime, Ressourcen, Betriebssystem, ausgehendes Netzwerk, Zugang und Neustartmethode bestätigt.
  2. After connecting through the confirmed SSH path, create a non-root administrator and run updates through sudo apt update && sudo apt upgrade. Review the proposed package changes before accepting them.Erstelle nach der Verbindung über den bestätigten SSH-Weg einen Administrator ohne Root-Daueranmeldung und führe Updates mit sudo apt update && sudo apt upgrade aus. Prüfe die vorgeschlagenen Paketänderungen vor der Bestätigung.
  3. Install your runtime ·Installiere deine Runtime, nodejs/npm for a JS bot, orfür einen JS-Bot, oder python3/pip/venv for a Python one.für einen Python-Bot.

Step 2, Deploy your botSchritt 2, Bot deployen

Clone your code (git) or upload it, install dependencies (Klone deinen Code (git) oder lade ihn hoch, installiere Abhängigkeiten (npm install oroder pip install -r requirements.txt), and put your bot token in an environment variable or a), und leg dein Bot-Token in eine Umgebungsvariable oder eine .env file, never hard-code it. Test that it starts and connects.Datei, hardcode es nie. Teste, dass er startet und verbindet.

Step 3, Keep it aliveSchritt 3, am Leben halten

You want the bot to restart on crash and on reboot. Two standard ways:Du willst, dass der Bot bei Absturz und Neustart neu startet. Zwei Standardwege:

Avoid running the bot in a bareVermeide es, den Bot in einem nackten screen/tmux long-term, it won't survive a reboot. pm2 or systemd is the right tool.auf Dauer, es übersteht keinen Neustart. pm2 oder systemd ist das richtige Werkzeug.

Step 4, MaintainSchritt 4, Warten

Review logs, keep the supported operating system and runtime updated, monitor restart results and preserve a restorable copy before major changes. External health checks should verify a real bot response rather than only a running process.Prüfe Logs, halte unterstütztes Betriebssystem und Laufzeit aktuell, überwache Neustartergebnisse und sichere vor größeren Änderungen eine wiederherstellbare Kopie. Externe Zustandsprüfungen sollten eine echte Bot-Antwort statt nur eines laufenden Prozesses bestätigen.

Technical guidance is informational. Any overnight.host configuration, capacity, backup, protection, support, final price and delivery timing must be confirmed in an accepted written offer before payment.Technische Hinweise dienen der Information. Jede overnight.host-Konfiguration sowie Kapazität, Backup, Schutz, Support, Endpreis und Lieferzeit müssen vor einer Zahlung in einem angenommenen schriftlichen Angebot bestätigt werden.

FAQ

Can I run a Discord bot on a cheap VPS?Kann ich einen Discord-Bot auf einem günstigen VPS laufen lassen?

Many lightweight bots need modest resources, but memory and CPU depend on language, libraries, caches, traffic and integrations. Measure the real process and add restart monitoring.Viele leichte Bots benötigen wenig Ressourcen; Arbeitsspeicher und CPU hängen jedoch von Sprache, Bibliotheken, Caches, Traffic und Integrationen ab. Miss den echten Prozess und überwache Neustarts.

Does a bot need a dedicated public IP?Braucht ein Bot eine dedizierte öffentliche IP?

A gateway-only Discord bot generally makes outbound connections and can work behind NAT. Public webhooks, dashboards or other inbound services need an explicitly mapped and protected path. Confirm the bot's exact integrations before deciding.Ein reiner Discord-Gateway-Bot baut gewöhnlich ausgehende Verbindungen auf und kann hinter NAT funktionieren. Öffentliche Webhooks, Dashboards oder andere eingehende Dienste benötigen einen ausdrücklich zugeordneten und geschützten Weg. Bestätige vor der Entscheidung die genauen Bot-Integrationen.

How do I keep the bot running after a crash or reboot?Wie halte ich den Bot nach einem Absturz oder Neustart am Laufen?

Use pm2 (pm2 startup + pm2 save) or a systemd service with Restart=always and enable it. Both auto-restart on crash and survive reboots, better than screen/tmux.Nutze pm2 (pm2 startup + pm2 save) oder einen systemd-Dienst mit Restart=always und aktiviere ihn. Beide starten bei Absturz automatisch neu und überstehen Neustarts, besser als screen/tmux.

Python or Node?Python oder Node?

Either can work when the chosen host confirms the required runtime, architecture, resources and access. Pin supported versions and test the bot's real dependency installation.Beides kann funktionieren, wenn der gewählte Host benötigte Laufzeit, Architektur, Ressourcen und Zugang bestätigt. Fixiere unterstützte Versionen und teste die echte Abhängigkeitsinstallation des Bots.

RelatedVerwandt

VPS for Discord botsVPS für Discord-Bots

Available to order in the shop; listed prices are final totals (§19 UStG). Custom configurations are confirmed in writing by email.Im Shop bestellbar; die angegebenen Preise sind Endpreise (§19 UStG). Individuelle Konfigurationen werden per E-Mail schriftlich bestätigt.

What is a KVM VPS?Was ist ein KVM-VPS?

Why full root and your own kernel matter.Warum voller Root-Zugriff und dein eigener Kernel wichtig sind.

NAT IPv4 vs dedicated IPNAT-IPv4 vs. dedizierte IP

Why NAT is fine for bots.Warum NAT für Bots in Ordnung ist.

Ready to order?Bereit zu bestellen?

Prices are final totals; no VAT is shown (§19 UStG). Need something the shop does not list? Email us for a written offer.Alle Preise sind Endpreise ohne ausgewiesene USt. (§19 UStG). Du brauchst etwas, das nicht im Shop steht? Schreib uns für ein schriftliches Angebot.

No public promotion is active.Es ist keine öffentliche Aktion aktiv.

Order now →Jetzt bestellen → Request a custom configIndividuelle Konfiguration anfragen
🛠️ Try the free tool🛠️ Probier das kostenlose Tool
Cron expression generator →Cron-Ausdruck-Generator →