Skip to content

Run on Unraid

JMusicBot has an Unraid template, for Community Applications or to add by hand. It runs the Docker image, and you fill in the bot token and your user ID on the template page. You don't need a config file to start.

You need a bot token and your user ID first.

Needs version 0.10.0 or newer

Setting the token and owner on the template page needs version 0.10.0 or newer of the image. The template uses the latest tag, which is always the newest release.

Install

  1. In Unraid, open the Apps tab and search for JMusicBot. Pick the one by arif-banai and click Install.
  2. Fill in the template:

    Field What to put
    Bot token Your bot token. Unraid hides it on the page.
    Owner user ID Your Discord user ID, the 17 to 19 digit number.
    Appdata Where the bot keeps config.txt, playlists and settings. The default is /mnt/user/appdata/jmusicbot.
  3. Click Apply. Unraid downloads the image and starts the bot.

  4. On the Docker tab, click the JMusicBot icon and choose Logs. Check the log for errors, then invite the bot to your server. If the container stops soon after SearchService initialized without an error, the token is wrong: copy it again, or reset it in the Developer Portal. See Troubleshooting.

On its first start the bot writes config.txt with the default settings to the appdata folder. Your token and owner ID aren't written to it: they stay in the template.

Not in Community Applications yet?

Add the template by hand. Open a terminal on the server (>_ at the top right of the web UI) and run:

wget -O /boot/config/plugins/dockerMan/templates-user/my-JMusicBot.xml \
  https://raw.githubusercontent.com/arif-banai/unraid-templates/main/jmusicbot.xml

Then on the Docker tab click Add Container, pick JMusicBot from the Template list, and carry on from step 2.

Change settings

Most settings are in config.txt in the appdata folder. Edit it (for example over the appdata share), then restart the container. See config.txt for every setting.

You can also set any setting from the template, which is handy if you'd rather not edit files. Click Add another Path, Port, Variable, Label or Device, choose Variable, and set:

  • Key: CONFIG_FORCE_ followed by the setting's name, with _ in place of each .. For example CONFIG_FORCE_commands_prefix for commands.prefix, or CONFIG_FORCE_playback_maxTrackSeconds for playback.maxTrackSeconds. Keep the capital letters in the setting's name.
  • Value: the value, without quotes.

A value set in the template wins over config.txt. An empty value is ignored. See Environment variables for the details.

Files and permissions

The template runs the bot as Unraid's usual nobody:users (99:100), so the files in appdata belong to the same user as your other apps. If the log says "Another instance of JMusicBot is already running", the bot can't write to the appdata folder. Give the folder to nobody:users from a terminal on the server, then restart the container:

chown -R 99:100 /mnt/user/appdata/jmusicbot

Moving from another JMusicBot template

If you used another JMusicBot template from Community Applications, your settings are in its appdata folder, usually /mnt/user/appdata/jmusicbot. Stop and remove the old container (keep the image if you like), install this template, and point Appdata at the same folder. The bot uses your existing config.txt and playlists, so you can leave the token and owner fields empty.

Updating

The template uses the latest tag. On the Docker tab, click Check for Updates, then apply update on JMusicBot. Your appdata folder keeps everything.

Memory and Java options

The image starts Java with ZGC and AlwaysPreTouch for smooth audio. To set a memory limit, click Show more settings on the template and fill in Java options, for example -Xms256m -Xmx512m -XX:+UseZGC -XX:+AlwaysPreTouch. See Performance tuning.

Spotify

Needs version 0.11.0 or newer

Spotify links need version 0.11.0 or newer of the image.

The template turns Spotify links on: Spotify enabled (under Show more settings) is true. Set it to false to turn them off. A value set in the template always wins over config.txt. See Spotify links for what they do.

For private playlists and Liked Songs, set Spotify login to true. It's blank by default, which leaves the choice to config.txt.

With login on, create spotifycookie.txt yourself in the appdata folder, next to config.txt, containing only the sp_dc cookie. See Logging in.

Next: Invite the bot.