JMusicBot Discord music bot on fly.io
Run your own Discord music bot for free (within free tier) on fly.io
- Fork this repository.
- On your own fork, click Code, and click Codespaces tab.
- Click "Create codespace on main".
- Check if JMusicBot version in
Dockerfile
is latest, if not, change to the latest version. - Login to flyctl by using
fly auth login
or you can generate access tokens and paste it toFLY_API_TOKEN
in Codespaces secrets. - Create an app on fly.io
fly launch --copy-config --name app-name --no-deploy --vm-memory 256
. - When asked to tweak these settings before proceeding, enter yes if you want to tweak settings like selecting the region closest to you, otherwise, enter no.
- After fly launch, flyctl will add
[http_service]
section, remove the whole[http_service]
section in fly.toml, we don't need that. - Set environment variables for JMusicBot.
fly secrets set -a app-name TOKEN=<your_discord_bot_token>
- Set your Discord user ID at the
config.txt
. - Deploy to fly.io
fly deploy -a app-name --ha=false
. - When asked to allocate a dedicated IPv4 address, enter no.
- Add the Discord bot to a server and check if the bot is online.
You need flyctl installed.
- Clone this repository.
- Check if JMusicBot version in
Dockerfile
is latest, if not, change to the latest version. - Login to flyctl by using
fly auth login
. - Create an app on fly.io
fly launch --copy-config --name app-name --no-deploy --vm-memory 256
. - When asked to tweak these settings before proceeding, enter yes if you want to tweak settings like selecting the region closest to you, otherwise, enter no.
- After fly launch, flyctl will add
[http_service]
section, remove the whole[http_service]
section infly.toml
, we don't need that. - Set environment variables for JMusicBot.
fly secrets set -a app-name TOKEN=<your_discord_bot_token>
- Set your Discord user ID at the
config.txt
. - Deploy to fly.io
fly deploy -a app-name --ha=false
. - When asked to allocate a dedicated IPv4 address, enter no.
- Add the Discord bot to a server and check if the bot is online.
Type fly deploy -a app-name
on the repository after editing config.txt
.
fly.io requires a credit card in order to work. If you don't have a credit card or if you are afraid that fly.io will charge you so much, it is recommended to buy prepaid credits that can be used with virtual credit cards.