Skip to content

Railway

Warning

Due to sharing an IP address with other Railway users (who are likely also hosting a Discord bot), you are more likely to encounter rate limits. It should be fine for testing or small servers, but you should consider other hosting options if you expect high usage.

Railway is also very limiting in access, which may make it difficult to troubleshoot issues or update the bot.

Pricing

Verified accounts(1) on Railway get $5 (or 500 hours) of usage per month for free. Depending on usage, you may be able to run the bot for free if you don't have anything else running on your Railway account but may cost up to $6 per month ($1 after free usage).

  1. If you don't have an existing, active GitHub account, you may need to add a payment method to verify your account.

Deploying

Click the button below to deploy the bot on Railway.

Deploy on Railway

Environment variables

There are three environment variables that you need to set before deploying the bot.

Screenshot

Screenshot

Creating the Discord application

Info

This content is shared between all of the installation guides. Skip step 5 and come back to it later; Railway will give you a URL after you deploy the bot.

Warning

Don't skip this section if you already know how to create a Discord application; Discord Tickets requires additional configuration. Using an existing application is not recommended.

  1. Go to the Discord Developer Portal

  2. Create an application

    1. Click the New Application button
    2. Give your application a name, accept the terms of service and click Create

    Screenshot 3. Add a logo, description, and links to your terms of service and privacy policy, then click Save Changes.

    Screenshot 4. Go to the OAuth2 page and click Reset Secret, then Yes, do it!. Copy the new secret and set it as your DISCORD_SECRET environment variable.

    Screenshot 5. Click Add Redirect and enter the value of your HTTP_EXTERNAL environment variable, followed by /auth/callback. Then click Save Changes.

    Examples

    • http://12.345.67.89:8080/auth/callback
    • https://tickets.example.com/auth/callback

    If you set this to https://tickets.example.com/auth/callback, your HTTP_EXTERNAL environment variable must be set to https://tickets.example.com (without a trailing /).

    Screenshot 6. Create the bot user

    1. Go to the Bot page and click Add Bot, then Yes, do it!
    2. Click View Token, then copy the token and set it as your DISCORD_TOKEN environment variable.

    Screenshot 7. Configure the bot

    1. Optionally, disable the "public bot" option to prevent other people from adding your bot to their servers.
    2. Enable the presence, server members and message content intents.

    Screenshot

Don't add the bot to your Discord server yet; you'll do that later.

Other environment variables

The only other required environment variable that isn't set for you is ENCRYPTION_KEY. Copy the value below and paste it into the ENCRYPTION_KEY field on Railway.

Click to regenerate
Generating...

Tip

You can middle-click on links to open them in a new tab so you can easily come back to the documentation!

Refer to the configuration documentation for more information about the available environment variables, and return to this page when you have finished.

Environment variables


Finding and changing the URL

Click on the bot(1) service, then Settings.

  1. It may have a different name if you changed the name of your cloned repository.

Here you can copy the default URL or change the subdomain to something less generic. If you have one, you can also add a custom domain, which will look much better.

Go back to the Discord Developer Portal and add the URL as an allowed OAuth2 redirect URL.

Screenshot

Screenshot

Publishing the commands

You can't interact with the bot's console on Railway, so commands are published automatically at startup.

Next steps

If your bot is running, congratulations, you have successfully installed Discord Tickets, and now it's time to set it up in your Discord server.

Join the community on Discord and get notified when updates (with new features and fixes) are released.

Refer to the configuration guide for a step-by-step guide on how to add and configure the bot in your server.

Configuration

Having trouble?

If you haven't got the bot running yet and need help, you can ask for help on Discord or on GitHub.

Comments