Skip to content

rHomelab/Red-DiscordBot-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Red Discord Bot Docker

Docker Hub Pulls Docker Image Version (tag latest semver)

Red Discord Bot, now containerised.

Note

This is an unsupported deployment method for Red. Do not expect support from the developers of Red Discord Bot if you run into any issues.

Warning

BREAKING CHANGE: Additional redbot arguments passed via EXTRA_ARGS must now be passed as described in Additional Options.

Tags

Tags Red version
latest Latest release
x.x.x See tag

Environment Variables

Name Description Type Default
INSTANCE_NAME The name of your Red Bot instance.
Example: MyBot
string RedBot
PREFIX Your bot's command prefix.
Example: !
string
TOKEN Your bot token from Discord Developers. string
RPC_ENABLED Whether RPC is enabled or not. boolean false
RPC_PORT The port used by Red's RPC server, if enabled. string 6133
TEAM_MEMBERS_ARE_OWNERS Treat Discord Developers application team members as owners. boolean false
PIP_REQUIREMENTS Optional space-separated list of pip packages to install. string

Additional Options

If you wish to pass additional options to the redbot command, these can be added to the command option in docker-compose.yml or appended to the docker run command.

Warning

Do not add arguments which conflict with existing environment variables, such as --prefix, --rpc, etc.

Tip

You can see a full list of redbot options here.

Setup

See the docker-compose-example.yml for a basic example of a working bot with Docker Compose.

After running the steps below, your Red Discord Bot will be alive!

Running the bot with Docker Compose

Create a docker-compose.yml file based on the example and configure the environment variables to suit your desired configuration.

Be sure to update the /opt/redbot path if you wish your bot's persistent data to be stored elsewhere.

Now run docker compose up -d and see your bot come alive!

To retrieve the invitation URL, run docker compose logs RedBot. If you only started the container a few moments ago, you may need to wait a few seconds for the bot to be created, started, and connected.

Running the bot with docker run

Basic setup:

docker run -d \
  --name 'RedBot' \
  -v /opt/redbot:/redbot/data \
  -e "INSTANCE_NAME=RedBot" \
  -e "PREFIX=^" \
  -e "TOKEN=yourBotToken" \
  ghcr.io/rhomelab/red-discordbot:latest

With extra command arguments (see Additional Options above), for example to allow mentioning the bot as an alternative to using the bot prefix:

docker run -d \
  --name 'RedBot' \
  -v /opt/redbot:/redbot/data \
  -e "INSTANCE_NAME=RedBot" \
  -e "PREFIX=^" \
  -e "TOKEN=yourBotToken" \
  ghcr.io/rhomelab/red-discordbot:latest \
  --mentionable

To retrieve the invitation URL, run docker logs RedBot. If you only started the container a few moments ago, you may need to wait a few seconds for the bot to be created, started, and connected.