Debian
Deploy Modmail on Debian / Raspberry Pi OS.
For safety reasons, DO NOT install Modmail with a root user. A misbehaving or malicious plugin installed on your Modmail bot can easily access your entire system. If you are unsure how to create a new user on Linux, see DigitalOcean’s tutorial: How To Create a New Sudo-enabled User.
Raspberry Pi OS 11 Bullseye and Raspberry Pi OS 10 Buster are based on Debian 11 Bullseye and Debian 10 Buster respectively so you can essentially follow this guide if you're running any of the OS mentioned above.
Prerequisites
Root access (
sudo
).Minimum 1GB of RAM
At least 2GB available disk space.
Supported releases:
Debian 11 Bullseye
Debian 10 Buster
Raspberry Pi OS 11 Bullseye
Raspberry Pi OS 10 Buster
Dependencies
Python 3.9 / 3.10
Tools:
git
,wget
,nano
Additional Modmail requirements:
libcairo2-dev
,libffi-dev
,g++
All code blocks should be executed in bash and line by line unless specified otherwise.
To install these dependencies, we will be using apt
.
Debian 11 Bullseye / Raspberry Pi OS 11 Bullseye
At the time of writing, this will install Python 3.9 from Debian's repository.
Debian 10 Buster / Raspberry Pi OS 10 Buster
You will need to manually compile Python 3.10 from source. Compiling Python may take a while (est. 5-10 minutes). Make sure to run line 2-7 all at once.
After that, ensure pip
is installed and updated for Python 3.10 with:
Then log out and log back in to continue the installation steps.
Installing Bot
Clone and change directory into the Modmail folder with:
Inside the Modmail folder, Install pipenv
and the bot dependencies with:
Replace 3.9
with 3.10
on the command above if you followed Debian 10 Buster method previously.
Create a file named .env
with nano
and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the parent Installation page to find where to obtain these.
After that, press Ctrl+O
and Enter
to save your changes. Exit the nano
editor with Ctrl+X
.
If using the nano
editor is a bit of a learning curve, you can always FTP into your server using software like WinSCP to edit the .env
file manually with your preferred GUI-based editor like Notepad.
After your .env
file is ready, you can now go ahead and try running your bot with:
Replace 3.9
with 3.10
on the command above if you followed Debian 10 Buster method previously.
If no error shows up, it means your bot is now running correctly. You can stop the bot from running with Ctrl+C
to continue using your terminal.
Last updated