Ubuntu
Deploy Modmail on an Ubuntu server.
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.
Prerequisites
Root access (
sudo
).Minimum 1GB of RAM
At least 2GB available disk space.
Supported releases:
Ubuntu 18.04 LTS (Bionic Beaver)
Ubuntu 20.04 LTS (Focal Fossa)
Ubuntu 22.04 LTS (Jammy Jellyfish)
Dependencies
We will be using the following dependencies:
Python 3.10
Tools:
git
,wget
,nano
,software-properties-common
Additional Modmail requirements:
libcairo2-dev
,libffi-dev
,g++
To install these dependencies, we will be using apt
.
We recommend adding the deadsnakes
ppa to install Python 3.10:
sudo apt update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
Now install the pre-requirements with apt
, you can copy and run these 3 lines at once:
sudo apt -y install python3.10 python3.10-dev python3.10-venv python3-pip \
libcairo2-dev libffi-dev g++ \
git nano
After that, install pipenv
with:
python3.10 -m pip install pipenv
Installing Bot
Clone and change directory into the Modmail folder with:
git clone https://github.com/modmail-dev/modmail
cd modmail
Inside the Modmail folder, Install pipenv
and its Python packages with:
python3.10 -m pipenv install --python 3.10
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.
nano .env

After that, press Ctrl+O
and Enter
to save your changes. Exit the nano
editor with Ctrl+X
.
After your .env
file is ready, you can now go ahead and try running your bot with:
python3.10 -m pipenv run bot
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