Modmail Docs
GitHubDonateSetupDiscord Server
  • Introduction
  • Installation
    • Local hosting / VPS
      • Windows
      • MacOS
      • Docker
      • Ubuntu
      • Debian
      • Fedora
      • Alma Linux
      • Logviewer
      • Patreon logviewer
    • Railway
    • Heroku
    • Community Guides
  • Setting up auto-restart
  • Updating
  • Getting Started
  • Usage
    • Plugins
    • Configuration
    • Permissions
  • Frequently Asked Questions
  • OLD DOCS
    • Installation
    • Installation (continued)
    • Color Names
    • Configuration Variables (Config Vars)
    • Configure Modmail and Logviewer
    • Frequently Asked Questions
    • Modmail Usage
    • Updating
    • Video Tutorials
Powered by GitBook
On this page
  • What is Railway?
  • Requirements
  • Costs
  • Fork our GitHub repositories
  • Create a Railway account
  • Part 1: Deploying the Logviewer
  • Part 2: Deploying the Modmail bot
  • Complete the setup
  • How to keep your bot running 24/7
  • Updating
  • Next steps

Was this helpful?

Edit on GitHub
  1. Installation

Railway

Deploy Modmail on Railway PaaS.

PreviousPatreon logviewerNextHeroku

Last updated 11 months ago

Was this helpful?

What is Railway?

Railway is a deployment platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.

Requirements

  • A credit card.

  • An email account.

  • A account.

  • You have completed the initial steps: and .

Costs

Their lowest plan starts at $5 per month. Visit the page for the up-to-date pricing info.

Fork our GitHub repositories

You will need to fork our repositories to deploy onto Railway.

Make sure you're logged in to . You will need to fork two repositories.

First we fork the Modmail repository. Head over to , leave all the settings as default, and click Create fork.

Create a Railway account

Why does it says "Your Account is Unverified"?

If your GitHub account is new or not reputable, you may be asked to verify your identify.

This unfortunately means that you will have to provide a credit card for verification. Click Verify Account, read and accept Railway's Terms of Service, then enter your credit card details. You may be temporary charged $1 USD to confirm the legitimacy of the card.

Next, you will be asked to Configure a GitHub App. You will be directed to the GitHub authentication page. Choose Only select repositories, then select both the Modmail and Logviewer repositories, as you have done before. Finally, click Install & Authorize.

The next step is to deploy Modmail onto Railway. This is split into two parts. You will need to complete both parts to fully Modmail.

Part 1: Deploying the Logviewer

Don't add any other variables, nor use the suggested variables section. You should see a new variable named CONNECTION_URI added under variables once you're done.

Next, go to the Deployments tab, look at the latest deployment, is it successful? You may need to wait up to 10 minutes. If you click the URL, you should be taken to your Logviewer homepage (see screenshot below). Save this URL into your Notepad as we will need it for the next step, we will be referring to this as your Logviewer URL.

Part 2: Deploying the Modmail bot

Click New Variable. We will be adding 5 variables in total, so repeat this step until you've added all 5 variables.

Variable Name (left)
Variable Value (right)
Example

CONNECTION_URI

The MongoDB Connection string from your Notepad.

TOKEN

The Discord bot token from your Notepad.

LOG_URL

The Logviewer URL from your Notepad. Remember to add https:// in front!

OWNERS

Your Discord ID. If you have multiple owners, separate your IDs with a comma.

GUILD_ID

The ID of the Discord server for your Modmail bot.

Do you have a separate staff server?

If you manage a large server where you have a separate server for communication among your moderation team, Modmail supports directing threads into the staff server instead of your main (public) server.

Simply add an additional variable named MODMAIL_GUILD_ID and set the value to your staff server's ID.

Note: the GUILD_ID should always be your main server's ID (not staff server's).

Complete the setup

Within 10 minutes of saving the Modmail bot variables, your Modmail bot should come online in your server. The default prefix for Modmail is ?. You need to run ?setup within your server to complete the setup. If you configured Modmail to use a separate staff server, you must run this command in your staff server. This will create a category for your Modmail threads and a Logs channel for an archive of all past threads.

Help! My bot hasn't started after 10 minutes.

This probably means you've failed to follow one or more steps. [more info TODO]

How to keep your bot running 24/7

Usage-based subscription

Subscribing to the Developer plan under usage based subscription may incur you unexpected charges. This because Railway does not provide any safe-guards or monthly spending limits. Average Modmail and Logviewer usage should be well below the free threshold. However, if you run resource-intensive code via plugins or due to other means, you credit card may be billed.

Why was I charged $1.00 USD?

This should be a temporary charge to verify that your credit card works as expected. Railway explains this with:

A temporary hold of $1.00 USD will be placed on the card and then refunded immediately.

Credit-based subscription (alternative subscription model)

If you rather pay a one-time $5.00 USD non-refundable credit purchase instead of permanently linking your credit card, you can choose to use the credit-based subscription model. As long as you have a non-zero credit balance (which should be forever since the monthly operating cost for Modmail is $0.00), you will be continuously subscribed to the Developer plan.

How do I cancel my Developer plan subscription?

Updating

Railway is configured to automatically update your Modmail bot and Logviewer whenever new updates become available.

How do I disable auto-updates?

Next steps

Next do the same for the Logviewer repository by heading over to , leave all the settings as default, and click Create fork.

Next, to keep your Modmail and Logviewer up to date, you will need to install the . Simply head over to , click Install, choose Only select repositories, then select both the Modmail and Logviewer repositories that you forked in the previous step.

Your GitHub should now be all set. Next step, to deploy your bot.

Head over to and create an account. It will ask you to create a new project, choose Deploy from GitHub repo. Then, you will be asked to connect your GitHub account.

From the page, create the project by selecting your Logviewer repository, then select Add variables.

Click New Variable, set left to be CONNECTION_URI, then on the right, paste your revised MongoDB connection string from your Notepad (if this is new to you, ).

From the page, create the project by selecting your Modmail repository, then select Add variables.

If you haven't yet invited your Modmail bot to your staff server, see the .

You have 10 days to test Modmail without upgrading to the "Developer" plan. As mentioned in the section, Railway's Developer plan provides enough free monthly credits to run Modmail for free 24/7 everyday. However, you will need to provide your credit card details to upgrade your plan. More details can be found .

Head over to the **** page, click the Unlock button to unlock Developer plan. Then input your credit card details and hit Subscribe to Developer Plan.

If you want to guarantee that your credit card won't get charged for whatever reason, check out the instead. Alternatively, you can use a virtual credit card, such as , to verify for the Developer plan.

There you go! Your bot should now be able to run 24/7 without interruptions. Head over to the page to make sure you won't be charged. Add up the estimated price for both your projects and verify that they're well below $5.00 USD.

If you're subscribed under the model, you can cancel your subscription by heading to the **** page, click Manage Subscription, then click Cancel plan.

You can disable auto-updates by heading to the settings page for both your Modmail and Logviewer projects. Under Automatic Deployments, click Disable trigger.

Now that you've successfully set up Modmail, visit the page to find information on using Modmail.

You can also join our to interact with our community or get support for Modmail.

mongodb+srv://modmail:elAO7wF1r07pNG6u@cluster0.example.mongodb.net
MTA3Djv3IAxNjk1NDgdKD231.G1AoUjD.5z629aKP34JKHn4v1EsdNUwdDO3MvBR9ifVES4
https://web-production-1234.up.railway.app
718827787302791100
109483701365508619
https://github.com/modmail-dev/logviewer/fork
Pull app
https://github.com/apps/pull
Railway's website
New Project
go back and read the initial steps
New Project
Billing Details
Usage
Getting Started
Discord Server
create a Railway account
here
costs
privacy.com
credit-based subscription model
Billing Details
usage-based subscription
GitHub
pricing
GitHub
https://github.com/modmail-dev/modmail/fork
New projectRailway
Sign up for a new Railway account.
Logo
Screenshot of creating a Modmail fork.
Create a GitHub fork for the Modmail Repository.
Screenshot of creating a Logviewer fork.
Create a GitHub fork for the Logviewer Repository.
Screenshot of selecting the deploy from GitHub repo option.
Choose Deploy from GitHub repo when creating a new project.
Screenshot of choosing configure GitHub app.
Click Configure a GitHub App.
Screenshot of selecting both repositories.
Select both the Modmail and Logviewer forks, then click Install & Authorize.
Screenshot of selecting the Logviewer repository.
Choose your Logviewer repository fork.
Screenshot of choosing Add Variables.
Click on Add variables. Alternatively, the following page can also be found within the project -> variables menu.
Screenshot of clicking new variable.
Click on New Variable.
Screenshot of filling left and right boxes then click add.
Left side: CONNECTION_URI. Right side: your MongoDB connection string. Then click + Add.
Screenshot of the completed variables page.
Once you've added the variable, you should see a single variable named CONNECTION_URI.
Screenshot of the deployments tab, and clicking the URL.
Navigate to the Deployments tab, save and open this URL.
Screenshot of the Logviewer homepage.
This URL should show the Logviewer homepage.
Screenshot of selecting the Modmail repository.
Choose your Modmail repository fork.
Screenshot of choosing Add Variables.
Click on Add variables. Alternatively, the following page can also be found within the project -> variables menu.
Screenshot of clicking new variable.
Click on New Variable.
Screenshot of the completed variables page.
Once you've added the variable as per the table above, you should see 5 variables here.
Screenshot of clicking the unlock button.
Click the Unlock button next to Unlock Developer Plan.
Screenshot of filling in credit card details and clicking subscribe.
Fill in your credit card details then click Subscribe to Developer Plan.
Screenshot of clicking the unlock button.
Click the Unlock button next to Unlock Developer Plan.
Screenshot of clicking credit-based subscription.
Click Credit-based subscription at the bottom.
Screenshot of entering credit card info, $5 amount, and click purchase credits.
Fill in your credit card details, enter $5.00 as the amount (it's the minimum), then click Purchase Credits.
Screenshot of the usage page.
Estimated Bill should be $0.00 and the sum of the Estimated should be well below $5.00.
Screenshot of clicking verify account.
Screenshot of clicking terms of service.
Screenshot of clicking I agree with terms of service.
Screenshot of entering your credit card details.
Screenshot of clicking manage subscription.
Screenshot of clicking cancel plan.
Screenshot of installing the pull app.
Click Install to install the .
Screenshot of selecting both repositories.
Select both the Modmail and Logviewer forks, then click Install.
Pull app
invited your bot
created a MongoDB database
invite section