Skip to content

NadekoBot CLI Guide (via Bash Installer)

Supported Operating Systems

  • Ubuntu: 20.04, 22.04, 24.04
  • Mint: 19, 20, 21
  • Debian: 10, 11, 12
  • RockyLinux: 8, 9
  • AlmaLinux: 8, 9
  • openSUSE Leap: 15.5, 15.6
  • openSUSE Tumbleweed
  • Fedora: 38, 39, 40, 41, 42
  • Arch & Artix
  • macOS 13 (Ventura) or later

Prerequisites

macOS:

Linux:


24/7 Up-time via VPS (Digital Ocean Guide)

Setting up Nadeko on a Linux VPS (Digital Ocean Droplet)

If you want Nadeko to play music for you 24/7 without having to hosting it on your PC and want to keep it cheap, reliable and convenient as possible, you can try Nadeko on Linux Digital Ocean Droplet using the link DigitalOcean (by using this link, you will get $10 credit and also support Nadeko)

To set up the VPS, please select the options below

These are the min requirements you must follow:

OS: Any between Ubuntu, Fedora, and Debian

Droplet Type: SHARED CPU | Basic

CPU options: Regular | Disk type: SSD
6$/mo
1 GB / 1 CPU
25 GB SSD Disk
1000 GB transfer

Note: You can select the cheapest option with 512 MB / 1 CPU but this has been a hit or miss.

Datacenter region: Choose one depending on where you are located.

Authentication: Password or SSH
(Select SSH if you know what you are doing, otherwise choose password)
Click create droplet
Setting up NadekoBot Assuming you have followed the link above to setup an account and a Droplet with a 64-bit operational system on Digital Ocean and got the IP address and root password (in your e-mail) to login, it's time to get started.

This section is only relevant to those who want to host Nadeko on DigitalOcean. Go through this whole section before setting the bot up.

Prerequisites

Starting up

  • Open PuTTY and paste or enter your IP address and then click Open. If you entered your Droplets IP address correctly, it should show login as: in a newly opened window.
  • Now for login as:, type root and press enter.
  • It should then ask for a password. Type the root password you have received in your e-mail address, then press Enter.

If you are running your droplet for the first time, it will most likely ask you to change your root password. To do that, copy the password you've received by e-mail and paste it on PuTTY.

  • To paste, just right-click the window (it won't show any changes on the screen), then press Enter.
  • Type a new password somewhere, copy and paste it on PuTTY. Press Enter then paste it again.

Save the new password somewhere safe.

After that, your droplet should be ready for use.

Creating a Discord Bot & Getting Credentials

Creating your own Discord bot

This guide will show you how to create your own discord bot, invite it to your server, and obtain the credentials needed to run it.

  1. Go to the Discord developer application page.
  2. Log in with your Discord account.
  3. Click New Application.
  4. Fill out the Name field however you like, accept the terms, and confirm.
  5. Go to the Bot tab on the left sidebar.
  6. Click on the Add a Bot button and confirm that you do want to add a bot to this app.
  7. Optional: Add bot's avatar and description.
  8. Copy your Token to creds.yml as shown above.
  9. Scroll down to the Privileged Gateway Intents section
    • You MUST enable the following:
      • PRESENCE INTENT
      • SERVER MEMBERS INTENT
      • MESSAGE CONTENT INTENT

Inviting your bot to your server

Invite the bot to your server

  • On the General Information tab, copy your Application ID from your applications page.
  • Replace the YOUR_CLIENT_ID_HERE in this link: https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=66186303 with your Client ID
  • The link should now look something like this: https://discordapp.com/oauth2/authorize?client_id=123123123123&scope=bot&permissions=66186303
  • Access that newly created link, pick your Discord server, click Authorize and confirm with the captcha at the end
  • The bot should now be in your server

Installation Instructions

Open Terminal (if you're on an installation with a window manager) and navigate to the location where you want to install the bot (for example cd ~)

  1. First make sure that curl is installed

    sudo apt install curl
    
    sudo dnf install curl
    
    sudo zypper install curl
    
    sudo pacman -S curl
    
    brew install curl
    
  2. Download and run the new installer script

    cd ~
    curl -L -o n-install.sh https://raw.githubusercontent.com/nadeko-bot/bash-installer/refs/heads/v6/n-install.sh
    bash n-install.sh
    

  3. Install the bot (type 1 and press enter)
  4. Edit creds (type 3 and press enter)
    • ALTERNATIVELY, you can exit the installer (option 6) and edit nadeko/creds.yml file yourself
  5. Follow the instruction below to create your own Discord bot and obtain the credentials needed to run it.
    • After you're done, you can close nano (and save the file) by inputting, in order:
      • CTRL + X
      • Y
      • Enter
  6. Run the installer script again
    • bash n-install.sh
  7. Run the bot (type 3 and press enter)
  8. Done!

Update Instructions

  1. ⚠ Stop the bot ⚠
  2. Navigate to your bot's folder, we'll use home directory as an example
    • cd ~
  3. Simply re-install the bot with a newer version by running the installer script
    • curl -L -o n-install.sh https://raw.githubusercontent.com/nadeko-bot/bash-installer/refs/heads/v6/n-install.sh && bash n-install.sh
  4. Select option 1, and select a NEWER version

Running Nadeko

There are two main methods to run NadekoBot: using tmux (macOS and Linux) or using systemd with a script (Linux only).

Using tmux is the simplest method, and is therefore recommended for most users.

Warning

Before proceeding, make sure your bot is not currently running by either running .die in your Discord server or exiting the process with Ctrl+C.

  1. Access the directory where n-install.sh and nadeko is located.
  2. Create a new tmux session: tmux new -s nadeko
    • The above command will create a new session named nadeko. You may replace nadeko with any name you prefer.
  3. Run the installer: bash n-install.sh
  4. Start the bot by typing 3 and pressing Enter.
  5. Detach from the tmux session, allowing the bot to run in the background:
    • Press Ctrl + B
    • Then press D

Now check your Discord server, the bot should be online. Nadeko should now be running in the background of your system.

To re-open the tmux session to either update, restart, or whatever, execute tmux a -t nadeko. (Make sure to replace "nadeko" with your session name. If you didn't change it, leave it as it is.)

Note

Systemd is only available on Linux. macOS utilizes Launchd, which is not covered in this guide. If you're on macOS, please use the tmux method, or use Upeko to run NadekoBot.

This method is a bit more complex and involved, but comes with the added benefit of better error logging and control over what happens before and after the startup of Nadeko.

  1. Access the directory where n-install.sh and nadeko is located.
  2. Use the following command to create a service that will be used to execute NadekoRun.bash:
    echo "[Unit]
    Description=NadekoBot service
    After=network.target
    StartLimitIntervalSec=60
    StartLimitBurst=2
    
    [Service]
    Type=simple
    User=$USER
    WorkingDirectory=$PWD
    ExecStart=/bin/bash NadekoRun.bash
    #ExecStart=./nadeko/NadekoBot
    Restart=on-failure
    RestartSec=5
    StandardOutput=journal
    StandardError=journal
    SyslogIdentifier=NadekoBot
    
    [Install]
    WantedBy=multi-user.target" | sudo tee /etc/systemd/system/nadeko.service
    
  3. Make the new service available: sudo systemctl daemon-reload
  4. Use the following command to create a script that will be used to start Nadeko:
    cat <<EOF > NadekoRun.bash
    #!/bin/bash
    
    export PATH="$HOME/.local/bin:$PATH"
    
    is_python3_installed=\$(command -v python3 &>/dev/null && echo true || echo false)
    is_yt_dlp_installed=\$(command -v yt-dlp &>/dev/null && echo true || echo false)
    
    [[ \$is_python3_installed == true ]] \\
        && echo "[INFO] python3 path: \$(which python3)" \\
        && echo "[INFO] python3 version: \$(python3 --version)"
    [[ \$is_yt_dlp_installed == true ]] \\
        && echo "[INFO] yt-dlp path: \$(which yt-dlp)"
    
    echo "[INFO] Running NadekoBot in the background with auto restart"
    if [[ \$is_yt_dlp_installed == true ]]; then
        yt-dlp -U || echo "[ERROR] Failed to update 'yt-dlp'" >&2
    fi
    
    echo "[INFO] Starting NadekoBot..."
    
    while true; do
        if [[ -d $PWD/nadeko ]]; then
            cd "$PWD/nadeko" || {
                echo "[ERROR] Failed to change working directory to '$PWD/nadeko'" >&2
                echo "[INFO] Exiting..."
                exit 1
            }
        else
            echo "[WARN] '$PWD/nadeko' doesn't exist" >&2
            echo "[INFO] Exiting..."
            exit 1
        fi
    
        ./NadekoBot || {
            echo "[ERROR] An error occurred when trying to start NadekoBot" >&2
            echo "[INFO] Exiting..."
            exit 1
        }
    
        echo "[INFO] Waiting 5 seconds..."
        sleep 5
        if [[ \$is_yt_dlp_installed == true ]]; then
            yt-dlp -U || echo "[ERROR] Failed to update 'yt-dlp'" >&2
        fi
        echo "[INFO] Restarting NadekoBot..."
    done
    
    echo "[INFO] Stopping NadekoBot..."
    EOF
    

With everything set up, you can run NadekoBot in one of three modes:

  1. Auto-Restart Mode: NadekoBot will restart automatically if you restart it via the .die command.
    • To enable this mode, start the service: sudo systemctl start nadeko
  2. Auto-Restart on Reboot Mode: In addition to auto-restarting after .die, NadekoBot will also start automatically on system reboot.
    • To enable this mode, run:
      sudo systemctl enable nadeko
      sudo systemctl start nadeko
      
  3. Standard Mode: NadekoBot will stop completely when you use .die, without restarting automatically.
    • To switch to this mode:
      1. Stop the service: sudo systemctl stop nadeko
      2. Edit the service file: sudo <editor> /etc/systemd/system/nadeko.service
      3. Modify the ExecStart line:
        • Comment out: ExecStart=/bin/bash NadekoRun.bash
        • Uncomment: #ExecStart=./nadeko/NadekoBot
      4. Save and exit the editor.
      5. Reload systemd: sudo systemctl daemon-reload
      6. Disable automatic startup: sudo systemctl disable nadeko
      7. Start NadekoBot manually: sudo systemctl start nadeko