Railway
Deploy Modmail on Railway PaaS.
Last updated
Deploy Modmail on Railway PaaS.
Last updated
Railway is a deployment platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
A credit card.
An email account.
A account.
You have completed the initial steps: and .
Their lowest plan starts at $5 per month. Visit the page for the up-to-date pricing info.
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.
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.
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.
Click New Variable. We will be adding 5 variables in total, so repeat this step until you've added all 5 variables.
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.
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.
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.
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.
Railway is configured to automatically update your Modmail bot and Logviewer whenever new updates become available.
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.
CONNECTION_URI
. Right side: your MongoDB connection string. Then click + Add.CONNECTION_URI
.