Self-Hosting Ticketer
Looking to host the Ticketer bot on your own machine or server? The only required software to do so is Docker Engine. Need help? Join the Ticketer support server! This tutorial assumes you are running Linux to self-host the bot but any other operating system should work fine as well.
Creating the Compose File
Create a directory/folder with any name (like "Ticketer") and then create a file in that directory named "compose.yaml".
$mkdir Ticketer && cd Ticketer$nano compose.yamlCopy and paste the following content in the created file:
Environment Variables
You will need the credentials to the Discord bot/application. If you have not already, create a new Discord application (enable the "Server Members" intent!) and edit the following variables with the appropriate credentials in a new file named .env.bot.production.local. The variable DISCORD_GUILD_ID is the server (ID) where private commands are used. Put the details inside the quotation marks for the variables that have them!
$nano .env.bot.production.localThe database also requires a few credentials to run. Create a file named .env.database.production.local and then create some login credentials with the following template below. You can change every variable to have whatever value you want except for DB_HOST.
$nano .env.database.production.localRunning the Bot
Now it is time to run the bot! Run the following command to start the database and bot (this may take some time):
$docker compose up -dTo deploy the application commands of the bot, run the following line:
$docker exec ticketer-bot sh -c "cd /src/apps/bot && pnpm commands:deploy:production"Once the commands have been deployed, run the /migrate command in Discord to deploy any database changes that may be needed:
/migrateIf you want to stop the database and bot, run the command below:
$docker compose downTo pull the latest image/version of the bot:
$docker compose pullAccessing The Database
If you want to access the database, you can do so by running the two commands below and replacing USERNAME with the username you chose in the environment variable:
$docker exec -it ticketer-database bash$mariadb -u USERNAME -p