Skip to content

Linux Install Instructions

Sellara edited this page Aug 6, 2024 · 15 revisions

How to install Azzy?

Install .NET 8 runtime

  • wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
  • chmod +x ./dotnet-install.sh
  • sudo ./dotnet-install.sh --channel 8.0 --runtime dotnet --install-dir /usr/share/dotnet
  • sudo nano /etc/profile.d/dotnet.sh
  • Add the following content to it
    • export DOTNET_ROOT=/usr/share/dotnet
    • export PATH=$PATH:/usr/share/dotnet
  • sudo chmod +x /etc/profile.d/dotnet.sh
  • source /etc/profile
  • dotnet --info
  • Search for .NET Runtime 8.0.x

Install Adoptium OpenJDK Runtime 21 LTS

Important

Only do this if you want to use the Music Streaming module!

  • apt install temurin-21-jre

Download the latest release

  • Go to the releases page
  • Download the latest version called release-linux-YOUR_ARCHITECTURE.zip
  • Upload the file to the server
  • Unzip the file on your server

Adjust the required settings to your likings

  • Get yourself an overview about all of the settings
  • nano /path/to/AzzyBot/Settings/appsettings.json
  • Adjust all settings as you want
  • Save via CTRL + X and Y
  • If you feel the need, get an overview about the full customization stuff we provide: follow me

Start the bot

Run normally

  • dotnet AzzyBot.dll

Run in background

  • nohup dotnet AzzyBot.dll &

Run as registered service

  • sudo nano /etc/systemd/system/AzzyBot.service
[Unit]
Description=AzzyBot
[Service]
WorkingDirectory=/path/to/AzzyBot
ExecStart=/usr/share/dotnet /path/to/AzzyBot.dll
Restart=always
User=Azzy
SyslogIdentifier=AzzyBot
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
  • sudo systemctl daemon-reload
  • sudo systemctl enable AzzyBot
  • sudo systemctl start AzzyBot

Let the bot be it's own user

Add new user

  • sudo adduser Azzy --allow-bad-names
  • Five times ENTER
  • Y

Modify the sudoers file

  • sudo visudo
  • Add these lines under # Allow members of group sudo to execute any command
%Azzy   ALL=NOPASSWD: /bin/systemctl restart AzzyBot
%Azzy   ALL=NOPASSWD: /bin/systemctl start AzzyBot
%Azzy   ALL=NOPASSWD: /bin/systemctl status AzzyBot
%Azzy   ALL=NOPASSWD: /bin/systemctl stop AzzyBot
%Azzy   ALL=NOPASSWD: /usr/bin/journalctl -u AzzyBot
  • Save via CTRL + X and Y
Clone this wiki locally