Linux Guide

Setting up EllieBot on Linux

Table of Contents
Linux From Source
Source Update Instructions
Linux Release
Release Update Instructions
Tmux (Preferred Method)
Systemd
Systemd + Script
Setting up Ellie on a VPS (Digital Ocean)

Operating System Compatibility

Compatible 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 & Tumbleweed
  • Fedora: 38, 39, 40, 41, 42

Linux From Source

Migration from v3 -> v5

Follow the following few steps only if you’re migrating from v3. If not, skip to installation instructions.

Use the new installer script: cd ~ && wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/linuxAIO.sh && bash linuxAIO.sh

  • Install prerequisites (type 1 and press enter)
  • Download (type 2 and press enter)
  • Run (type 3 and press enter)
  • Done
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. Download and run the new installer script cd ~ && wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/linuxAIO.sh && bash linuxAIO.sh
  2. Install prerequisites (type 1 and press enter)
  3. Download the bot (type 2 and press enter)
  4. Exit the installer (type 6 and press enter)
  5. Copy the creds.yml template cp elliebot/output/creds_example.yml elliebot/output/creds.yml
  6. Open elliebot/output/creds.yml with your favorite text editor. We will use nano here
    • nano elliebot/output/creds.yml
  7. Click here to follow creds guide
    • After you’re done, you can close nano (and save the file) by inputting, in order
      • CTRL + X
      • Y
      • Enter
  8. Run the installer script again cd ~ && wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/linuxAIO.sh && bash linuxAIO.sh
  9. Run the bot (type 3 and press enter)
Source Update Instructions
  1. ⚠ Stop the bot ⚠
  2. Update and run the new installer script cd ~ && wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/linuxAIO.sh && bash linuxAIO.sh
  3. Update the bot (type 2 and press enter)
  4. Run the bot (type 3 and press enter)
  5. πŸŽ‰

⚠ IF YOU ARE FOLLOWING THE GUIDE ABOVE, IGNORE THIS SECTION ⚠

Linux Release

Prerequisites
  1. (Optional) Installing Redis
    • ubuntu installation command: sudo apt-get install redis-server
  2. Playing music requires ffmpeg, libopus, libsodium and yt-dlp (which in turn requires python3)
    • Ubuntu installation command: sudo apt-get install ffmpeg libopus0 opus-tools libopus-dev libsodium-dev -y
    • yt-dlp installation command: sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp && sudo chmod a+rx /usr/local/bin/yt-dlp
  3. Make sure your python is version 3+ with python --version
    • if it’s not, you can install python 3 and make it the default with: sudo apt-get install python3.8 python-is-python3 You can use ellie bash script prerequisites installer as a reference
Installation Instructions
  1. Download the latest release from https://toastielab.dev/Emotions-stuff/elliebot/releases
    • Look for the file called “X.XX.X-linux-x64-build.tar” (where X.XX.X is a series of numbers) and download it
  2. Untar it
    • ⚠ Make sure that you change X.XX.X to the same series of numbers as in step 1!
    • tar xf X.XX.X-linux-x64-build.tar
  3. Rename the elliebot-linux-x64 to elliebot
    • mv elliebot-linux-x64 elliebot
  4. Move into elliebot directory and make EllieBot executable
    • cd elliebot && chmod +x EllieBot
  5. Copy the creds.yml template
    • cp creds_example.yml creds.yml
  6. Open creds.yml with your favorite text editor. We will use nano here
    • nano elliebot/output/creds.yml
  7. Click here to follow creds guide
    • After you’re done, you can close nano (and save the file) by inputting, in order
      • CTRL + X
      • Y
      • Enter
  8. Run the bot
    • ./EllieBot
Release Update Instructions
  1. Stop the bot
  2. Download the latest release from https://toastielab.dev/Emotions-stuff/elliebot/releases
    • Look for the file called “x.x.x-linux-x64-build.tar” (where X.X.X is a version, for example 3.0.4) and download it
  3. Untar it
    • ⚠ Make sure that you change X.X.X to the same series of numbers as in step 2!
    • tar xf x.x.x-linux-x64-build.tar
  4. Rename the old elliebot directory to elliebot-old (remove your old backup first if you have one, or back it up under a different name)
    • rm -rf elliebot-old 2>/dev/null
    • mv elliebot elliebot-old
  5. Rename the new elliebot directory to elliebot
    • mv elliebot-linux-x64 elliebot
  6. Remove old strings and aliases to avoid overwriting the updated versions of those files
    • ⚠ If you’ve modified said files, back them up instead
    • rm elliebot-old/data/aliases.yml
    • rm -r elliebot-old/data/strings
  7. Copy old data
    • cp -RT elliebot-old/data/ elliebot/data
  8. Copy creds.yml
    • cp elliebot-old/creds.yml elliebot/
  9. Move into elliebot directory and make the EllieBot executable
    • cd elliebot && chmod +x EllieBot
  10. Run the bot
    • ./EllieBot

πŸŽ‰ Enjoy

Steps 3 - 9 as a single command

Don’t forget to change X.XX.X to match step 2.

tar xf X.XX.X-linux-x64-build.tar && \
rm -rf elliebot-old 2>/dev/null && \
mv elliebot elliebot-old && \
mv elliebot-linux-x64 elliebot && \
rm elliebot-old/data/aliases.yml && \
rm -r elliebot-old/data/strings && \
cp -RT elliebot-old/data/ elliebot/data && \
cp elliebot-old/creds.yml elliebot/ && \
cd elliebot && chmod +x EllieBot

Running Ellie

While there are two run modes built into the installer, these options only run Ellie within the current session. Below are 3 methods of running Ellie as a background process.

Tmux Method (Preferred)

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

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

If you are presented with the installer main menu, exit it by choosing Option 8.

  1. Create a new session: tmux new -s ellie

The above command will create a new session named ellie (you can replace β€œellie” with anything you prefer, it’s your session name).

  1. Run the installer: bash linuxAIO.sh

  2. There are a few options when it comes to running Ellie.

    • Run 3 to Run the bot normally
    • Run 4 to Run the bot with Auto Restart (This is may or may not work)
  3. If option 4 was selected, you have the following options

1. Run Auto Restart normally without updating EllieBot.
2. Run Auto Restart and update EllieBot.
3. Exit

Choose:
[1] to Run EllieBot with Auto Restart on "die" command without updating.
[2] to Run with Auto Updating on restart after using "die" command.
  • Run 1 to restart the bot without updating. (This is done using the .die command)
  • Run 2 to update the bot upon restart. (This is also done using the .die command)
  1. That’s it! to detatch the tmux session:
    • Press Ctrl + B
    • Then press D

Now check your Discord server, the bot should be online. Ellie 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 ellie. (Make sure to replace “ellie” with your session name. If you didn’t change it, leave it as it.)

Systemd

Compared to using tmux, this method requires a little bit more work to set up, but has the benefit of allowing Ellie to automatically start back up after a system reboot or the execution of the .die command.

  1. Navigate to the project’s root directory

    • Project root directory location example: /home/user/elliebot/
  2. Use the following command to create a service that will be used to start Ellie:

    echo "[Unit]
    Description=EllieBot service
    After=network.target
    StartLimitIntervalSec=60
    StartLimitBurst=2
    
    [Service]
    Type=simple
    User=$USER
    WorkingDirectory=$PWD/output
    # If you want Ellie to be compiled prior to every startup, uncomment the lines
    # below. Note  that it's not neccessary unless you are personally modifying the
    # source code.
    #ExecStartPre=/usr/bin/dotnet build ../src/EllieBot/EllieBot.csproj -c Release -o output/
    ExecStart=/usr/bin/dotnet EllieBot.dll
    Restart=on-failure
    RestartSec=5
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=EllieBot
    
    [Install]
    WantedBy=multi-user.target" | sudo tee /etc/systemd/system/ellie.service
  3. Make the new service available:

    • sudo systemctl daemon-reload
  4. Start Ellie:

    • sudo systemctl start ellie.service && sudo systemctl enable ellie.service

Systemd + Script

This method is similar to the one above, but requires one extra step, with the added benefit of better error logging and control over what happens before and after the startup of Ellie.

  1. Locate the project and move to its parent directory

    • Project location example: /home/user/elliebot/
    • Parent directory example: /home/user/
  2. Use the following command to create a service that will be used to execute EllieRun.sh:

    echo "[Unit]
    Description=EllieBot service
    After=network.target
    StartLimitIntervalSec=60
    StartLimitBurst=2
    
    [Service]
    Type=simple
    User=$USER
    WorkingDirectory=$_WORKING_DIR
    ExecStart=/bin/bash EllieRun.sh
    Restart=on-failure
    RestartSec=5
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=EllieBot
    
    [Install]
    WantedBy=multi-user.target" | sudo tee /etc/systemd/system/ellie.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 Ellie:

    {
    echo '#!/bin/bash'
    echo ""
    echo "echo \"Running EllieBot in the background with auto restart\"
    yt-dlp -U
    
    # If you want Ellie to be compiled prior to every startup, uncomment the lines
    # below. Note  that it's not necessary unless you are personally modifying the
    # source code.
    #echo \"Compiling EllieBot...\"
    #cd \"$PWD\"/elliebot
    #dotnet build src/EllieBot/EllieBot.csproj -c Release -o output/
    
    echo \"Starting EllieBot...\"
    
    while true; do
        if [[ -d $PWD/elliebot/output ]]; then
            cd $PWD/elliebot/output || {
                echo \"Failed to change working directory to $PWD/elliebot/output\" >&2
                echo \"Ensure that the working directory inside of '/etc/systemd/system/ellie.service' is correct\"
                echo \"Exiting...\"
                exit 1
            }
        else
            echo \"$PWD/elliebot/output doesn't exist\"
            exit 1
        fi
    
        dotnet EllieBot.dll || {
            echo \"An error occurred when trying to start NadekBot\"
            echo \"Exiting...\"
            exit 1
        }
    
        echo \"Waiting for 5 seconds...\"
        sleep 5
        yt-dlp -U
        echo \"Restarting EllieBot...\"
    done
    
    echo \"Stopping EllieBot...\""
    } > EllieRun.sh
  5. Start Ellie:

    • sudo systemctl start ellie.service && sudo systemctl enable ellie.service

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

If you want Ellie 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 Ellie on Linux Digital Ocean Droplet using the link DigitalOcean (by using this link, you will get $10 credit and also support Ellie)

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

Plan: Basic

CPU options: regular with SSD
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)

Setting up EllieBot 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 Ellie 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. Follow the guide from the beginning to set Ellie up on your newly created VPS.