← Back to Guides
Profile image for Thomas Smyth

By Thomas Smyth

Published 25th January 2022

Deploying a Discord Music Bot on Northflank

There’s no better way to end a busy day than by socialising with friends on Discord whilst a music bot spews out some sweet tunes. Fortunately, you can do exactly that with Muse, a free self-hosted Discord music bot.

This guide will show you how to deploy Muse on Northflank from its official Docker image.

  1. Create a deployment service. Choose external image as the deployment source and set the image path to codetheweb/muse:latest. Enter the environment variables required by Muse:

    DISCORD_TOKENAcquired from the Discord Developer Portal by creating a new application and then going to “Bot”.
    SPOTIFY_CLIENT_IDAcquired from the Spotify for Developers Dashboard by creating an app.
    SPOTIFY_CLIENT_SECRETAcquired from the Spotify for Developers Dashboard by creating an app.
    YOUTUBE_API_KEYAcquired by creating a new project in Google’s Developer Console, enabling the YouTube Data API, and creating an API key under “Credentials”.
    • For better music quality, we recommend starting with the nf-compute-20 plan (0.2 vCPU and 512 MB memory). Smaller plans may not be enough to play music without stuttering.

  2. To store your Muse configuration setup through Discord and to cache data for better performance you will have to configure a volume. Inside of your service navigate to “Volumes” and add a new volume. Set the container mount path to /data.

    • The 5GB default volume size should be plenty, but should you want more make sure to increase the CACHE_LIMIT so Muse makes full use of the extra storage!

  3. Once you have added a volume and the service has restarted, view the active container’s logs and wait for Muse to log a URL to invite your new Discord bot to your Discord server.

  4. Enter this URL into your browser, select the Discord server you want the Discord bot to join and authorise its requested permissions. Once your bot has been added to your server it will direct message the owner of the server to complete the installation and then instruct them how to operate it.

Using Northflank to deploy your Muse Discord music bot

Northflank allows you to deploy your code and databases within minutes. Sign up for a Northflank account and create a free project to get started.

  • Connect with your preferred VCS: GitHub, GitLab or Bitbucket
  • Manage build arguments and environment variables using secret groups
  • Scale vertically and horizontally with multiple replicas per service
  • Observe & monitor with real-time metrics & logs
  • Create pipelines and release workflow as you grow

Share this article with your network