You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1.5 KiB

id title sidebar_label
debian-discord-bot-setup Python Discord Bot hosten Python Discord Bot hosten

Hosten eines Discord Bots auf einem Debian VPS

Informationen

In diesem Tutorial wird dir gezeigt, wie du einen Discord Bot auf einem VPS, root oder Dedicated Server hostest. Du benötigst dafür eine beliebige Debian basierende Distro und Root Rechte. Melde dich zunächst als root mit dem SSH Client deiner Wahl an, z.B. PuTTY, Termius oder Tabby.

Installation

  1. Als erstes lädst du Python und screen herunter:

    sudo apt update && sudo apt install python3 pip3 screen
    
  2. Nun überträgst du mit WinSCP deine Bot source auf den server.

img

img

  1. Dann installierst du mit pip die benötigten Python Pakete:

    pip3 install paket1 paket2
    
  2. Teste ob dein Bot richtig funktioniert:

    python3 /pfad/zum/bot.py
    
  3. Wenn alles geklappt hat starte den Bot mit screen, damit du die SSH Sitzung schließen kannst:

    screen -dmS bot python3 /pfad/zum/bot.py
    
  4. (optional) Als letztes kannst du wenn du willst einen cronjob einrichten, damit der Bot automatisch beim hochfahren des Servers startet:

    crontab -e
    

    Wähle wenn du danach gefragt wirst einen Editor aus. Ich empfehle nano oder vim. Nun trage den cronjob ein.

    @reboot /usr/bin/screen -dmS userbot /usr/bin/python3 /pfad/zum/bot.py