Installing Ballsdex without Docker
The recommended way to run Ballsdex is using Docker, but you may have reasons to run it without this dependency.
This install method is supported but only recommended for the advanced users, there are a lot of additional steps and dependencies to manage yourself.
Info
Few commands will be given, but online guides are given instead. This is because instructions differ between operating systems, so you have to use what's best for you.
1. Setting up the database
Install PostgreSQL and start it. Create a database by following this guide.
You must then have a link to connect to the database in the following format: postgres://username:password@localhost:5432/database_name
Test that your database is up with the following command: psql -c "\l" postgres://username:password@localhost:5432/database_name
Check that your database appears in the list and that your user is the owner.
2. Requirements
git
Git is needed to download and update the source code.
uv
You will need our package manager uv
to install the dependencies, manage Python versions and
virtual environments.
Follow the instructions here to install uv on your system.
Tip
Ballsdex requires Python 3.13 at least.
If you don't have it installed, uv
will install it for you, but you can make the installation
lighter by installing Python 3.13 with your system's package manager.
Create a Discord bot account
You must first setup a Discord bot account. You can follow discord.py's tutorial to create and invite your bot.
For now, don't copy your token, but keep the page open.
Once this is configured, you also need to enable message content intent. Go to the "Bot" tab of your application, scroll down to "Privileged intents" and tick "Message content".
Info
You can fill the description of your application, it will appear under the "About me" section.
3. Download the source code
Type the following command to download the latest version of the bot:
Then you can use the command cd to change directory and open the folder you just downloaded:
4. Installing the bot
-
Download the bot's dependencies and install them in a virtual environment.
Info
If you don't have Python 3.13, it will also be downloaded for your virtual environment.
-
Open the virtual environment where your dependencies are
-
Export the
BALLSDEXBOT_DB_URL
environment variable with the link to Postgres you tested earlier. -
Check that the bot loads successfully. This should print the version number and exit.
-
Create the default configuration file
-
Open the
admin_panel
folder for the next steps -
Initialize the database
-
Initialize the admin panel
- Return to the previous directory for the next steps
5. Configure the bot
Follow this section from the main tutorial to fill the base settings.
6. Run the bot
Then, run python3 -m ballsdex
to start the bot! To shut it down, type Ctrl+C.
Tip
There are multiple options available when running the bot, do python3 -m ballsdex -h
to view them.
Running the admin panel
-
Open another shell with the virtualenv and the environment variables exported
-
Start the admin panel
- Follow this guide afterwards
Summary
Before running any command, do these:
Then
- Start the bot:
- Start the admin panel:
Updating the bot
- Pull the new files.
- Update dependencies
- Open the admin panel folder
- Update the database schemas
- Update the admin panel static files
- Restart the bot and admin panel