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ätigen Sie 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 brauchen Sie?

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. Messen Sie 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.Nutzen Sie 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.Erstellen Sie nach der Verbindung über den bestätigten SSH-Weg einen Administrator ohne Root-Daueranmeldung und führen Sie Updates mit sudo apt update && sudo apt upgrade aus. Prüfen Sie die vorgeschlagenen Paketänderungen vor der Bestätigung.
  3. Install your runtime ·Installieren Sie Ihre 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 (Klonen Sie Ihren Code (git) oder laden Sie ihn hoch, installieren Sie Abhängigkeiten (npm install oroder pip install -r requirements.txt), and put your bot token in an environment variable or a), und leg Ihr Bot-Token in eine Umgebungsvariable oder eine .env file, never hard-code it. Test that it starts and connects.Datei, hardcode es nie. Testen Sie, 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:Sie wollen, dass der Bot bei Absturz und Neustart neu startet. Zwei Standardwege:

Avoid running the bot in a bareVermeiden Sie 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üfen Sie Logs, halten Sie unterstütztes Betriebssystem und Laufzeit aktuell, überwachen Sie Neustartergebnisse und sichern Sie 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. Plans, specifications and final prices are listed in the shop. Managed automation and one-click app plans can be ordered directly and are provisioned automatically after payment. US locations (Dallas, TX and Charlotte, NC) are available for VPS, game server, voice and web hosting plans. Custom configurations are still arranged by e-mail.Technische Hinweise dienen der Information. Pläne, Spezifikationen und Endpreise stehen im Shop. Managed-Automation- und One-Click-App-Pläne können direkt bestellt werden und werden nach der Zahlung automatisch bereitgestellt. US-Standorte (Dallas, TX und Charlotte, NC) sind für VPS-, Gameserver-, Voice- und Webhosting-Pläne wieder bestellbar. Sonderkonfigurationen werden weiterhin per E-Mail vereinbart.

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. Messen Sie den echten Prozess und überwachen Sie 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ätigen Sie 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.Nutzen Sie pm2 (pm2 startup + pm2 save) oder einen systemd-Dienst mit Restart=always und aktivieren Sie 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. Fixieren Sie unterstützte Versionen und testen Sie 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 Ihr 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.

Tutorial

How to run a trading bot on a VPS 24/7Wie man einen Trading-Bot 24/7 auf einem VPS betreibt

Run it as a systemd service, keep the clock synced with chrony, and test the kill switch before you need it.Richten Sie ihn als systemd-Service ein, halten Sie die Uhr mit chrony synchron und testen Sie den Kill-Switch vorher.

Tutorial

How to run Docker Compose on a 1 GiB VPSWie man Docker Compose auf einem 1-GiB-VPS betreibt

Set memory limits, add swap, pin image tags and rotate logs so Docker Compose runs safely on 1 GiB of RAM.Setzen Sie Memory-Limits, richten Sie Swap ein, pinnen Sie Image-Tags und rotieren Sie Logs, damit Compose auf 1 GiB stabil läuft.

Tutorial

How to self-host n8n on a VPSWie man n8n selbst auf einem VPS hostet

Set up n8n with Docker Compose, dodge the NAT IPv4 webhook trap, and fix the issues that bite later.Richten Sie n8n mit Docker Compose ein, umgehen Sie die NAT-IPv4-Webhook-Falle und beheben Sie die Probleme, die später zuschlagen.

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). Sie brauchen etwas, das nicht im Shop steht? Schreiben Sie uns für ein schriftliches Angebot.

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

US locations available: Dallas, TX and Charlotte, NC for VPS and game servers. Order a VPS → · Order a game server → · Web hosting →
Also live from Germany (EU):
US-Standorte verfügbar: Dallas, TX und Charlotte, NC für VPS und Gameserver. VPS bestellen → · Gameserver bestellen → · Webhosting →
Ebenfalls verfügbar aus Deutschland (EU):

One-click apps, each isolated with its own hostname: Uptime Kuma, Vaultwarden, Gitea, Nextcloud, Ghost, n8n (waitlist) · Managed automation · Managed setupOne-Click-Apps, jeweils isoliert mit eigenem Hostnamen: Uptime Kuma, Vaultwarden, Gitea, Nextcloud, Ghost, n8n (Warteliste) · Managed Automation · Managed Setup

Order now →Jetzt bestellen → Request a custom configIndividuelle Konfiguration anfragen
Try the free toolProbieren Sie das kostenlose Tool
Cron expression generator →Cron-Ausdruck-Generator →