Self-hosting the bot
(With screenshots!)
You can get a custom bot for free by self-hosting it, but keep in mind:
✅ Pros of Self-Hosting:
Full control over your data and customization.
No recurring subscription fees.
Can be deployed on your own infrastructure.
⚠️ Cons of Self-Hosting:
Requires technical expertise for setup and maintenance.
You are responsible for updates, security, and backups.
Hosting costs (servers, bandwidth, etc.) may apply.
If hosting on a personal computer, it must remain powered on 24/7 for the bot to be available at all times, which also increases electricity costs.
No official support beyond the provided setup instructions, or for specific additional software installation; self-troubleshooting is required.
For a hassle-free experience with automatic updates, security patches, and support, consider using our managed custom bots!
Recommendations
Have patience and read carefully this guide
Be familiarized with the CLI (cmd.exe, bash, zsh)
If you already know how to use the CLI and you still need help, feel free to ask in this discord server in #support
Creating a bot account
Go to the Discord Developer Portal, and click "New Application"

A dialog box will appear asking for a name. Type the name of your new bot and click "Create"

Now let's configure your new Discord Bot
Head over the Bot tab
Enable the necessary privileged intents outlined, you can also upload the bot's icon and banner, or change its username
Save the changes
Click on "Reset Token", you will be prompted if you really want to proceed, click "Yes, do it!", the new token will be revealed, copy it and store it in a safe location
Head over the OAuth2 tab
Copy the client ID and store it in a safe location
Click on "Reset Secret", you will be prompted if you really want to proceed, click "Yes, do it!", the new secret will be revealed, copy it and store it in a safe location
Add another redirect URL
Paste
http://localhost:3000/api/auth/callback
. You can change this to fit your needsSave the changes


Install docker
Download and install Docker for your OS: https://docs.docker.com/engine/install/
Install git
Download and install git for your OS: https://git-scm.com/download
Install Member Counter
Open your terminal (cmd.exe, Terminal.app, etc) and run this command to download Member Counter
Now open the downloaded directory
Configuring Member Counter
Open the bot folder in your terminal and create a .env
file from the .env.example
file
A new .env
file will appear in the folder, open it with your favorite text editor (like notepad.exe, vim, vscode, etc)
You will see a bunch of variables to set, but you only need to set the following block of variables at the start of the file:
COOKIE_SECRET
: Choose some 32 character long password for encrypting session cookiesDISCORD_CLIENT_ID
: Paste here your Discord Bot Client IDDISCORD_CLIENT_SECRET
: Paste here your Discord Bot SecretDISCORD_BOT_INSTANCE_TOKEN
: Paste your Discord Bot TokenDISCORD_OAUTH2_REDIRECT_URI
: You will need to change this to allow using the website properly behind a reverse proxy or over other IP/hostname
Optional configuration
In order to use some additional counters, you must set the following variables:
YOUTUBE_API_KEY
Paste here your YouTube API key, you can get it hereTWITCH_CLIENT_ID
andTWITCH_CLIENT_SECRET
Paste here your Twitch app credentials, you can get them here
Prepare the database
Apply database migrations
Apply the database schema
Start Member Counter
Open again your terminal in the bot directory and use this command
If you see a message like this, that means you have successfully installed Member Counter, else, it will give you errors that you must fix (stop the bot with Ctrl+C and check the previous steps)
If the bot is working well, let's make the bot auto start when your PC or server boots up, focus your terminal window and hit Ctrl+C to stop the bot and then run it again in the background with this:
The bot will run in background, to stop it you can use
Last updated