Railway

Deploy Discord Bot Starter

A discord.js bot template written with TypeScript.

Deploy Discord Bot Starter

Just deployed

Deploy and Host Discord Bot Starter on Railway

Discord Bot Starter is a minimal TypeScript template for building Discord bots using the Sapphire framework. It provides a clean project structure with slash command support, Docker deployment, pnpm package management, and modern development tooling, making it an excellent starting point for creating production-ready Discord bots.

About Hosting Discord Bot Starter

Railway provides an easy way to deploy your Discord bot without managing servers or infrastructure. This template automatically builds the application from its included Dockerfile and runs the bot continuously, ensuring it stays online 24/7. Railway manages deployments, environment variables, logs, and scaling while your bot connects directly to Discord using its Bot Token. Since the bot communicates with Discord over outbound connections, no public HTTP endpoint, database, or persistent storage is required unless your bot stores additional application data.

Common Use Cases

  • Create moderation and administration bots for Discord servers.
  • Build custom slash commands and automation workflows.
  • Develop community, gaming, or AI-powered Discord assistants.

Dependencies for Discord Bot Starter Hosting

DependencyRequiredPurpose
Discord Bot TokenYesAuthenticates your bot with Discord.

Deployment Dependencies

ResourceLink
GitHub Repositoryhttps://github.com/threeal/discord-bot-starter
Discord Developer Portalhttps://discord.com/developers/applications
Sapphire Framework Documentationhttps://www.sapphirejs.dev
Discord Developer Documentationhttps://discord.com/developers/docs

Implementation Details

Docker

Railway automatically builds the application using the included Dockerfile.

No custom Docker configuration is required.

Public Networking

This application does not expose a public web server.

No networking configuration or Railway domain is required.

Environment Variables

Configure the following Railway Variable before deploying.

VariableRequiredDescription
DISCORD_TOKENYesYour Discord Bot Token.

Raw Editor example:

DISCORD_TOKEN=your_discord_bot_token

Persistent Storage

No Railway Volume is required.

Database

No database is required.

Build & Start

Railway automatically builds the application from the included Dockerfile.

No custom build or start commands are required.

Accessing the Application

This template runs as a background service and does not provide a web interface.

After deployment, the bot automatically connects to Discord using the configured bot token. You can monitor startup, errors, and command execution through the Railway Deploy Logs.

Creating a Discord Bot Token

Before deploying, you'll need to create a Discord application and obtain a Bot Token.

  1. Visit the Discord Developer Portal: https://discord.com/developers/applications

  2. Click New Application.

  3. Enter an application name and click Create.

  4. From the sidebar, select Bot.

  5. Click Add Bot, then confirm.

  6. Under the Bot section, click Reset Token (or Copy Token if already generated).

  7. Copy the generated Bot Token.

  8. In Railway, open your service and navigate to Variables.

  9. Add:

DISCORD_TOKEN=your_bot_token

Inviting the Bot to Your Server

After creating the bot:

  1. Open the OAuth2 → URL Generator page.

  2. Under Scopes, select:

  • bot
  • applications.commands
  1. Under Bot Permissions, choose the permissions your bot requires (for example, Send Messages, Read Message History, Manage Messages, etc.).

  2. Copy the generated invitation URL.

  3. Open the URL in your browser.

  4. Select your Discord server.

  5. Click Authorize.

  6. Complete the CAPTCHA if prompted.

The bot will now join your Discord server.

Using the Bot

Once deployed:

  1. Verify the deployment completed successfully in Railway.
  2. Open Deploy Logs to confirm the bot connected successfully.
  3. Open your Discord server.
  4. The bot should appear online.
  5. Use the configured slash commands (such as /) to interact with the bot.
  6. Modify the files inside the src directory to add your own commands and functionality, then redeploy to Railway to apply the changes.

Why Deploy Discord Bot Starter on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Discord Bot Starter on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Telegram JavaScript Bot
A template for Telegram bot in JavaScript using grammY

Agampreet Singh
295
View Template
Cobalt Tools [Updated Aug ’26]
Cobalt Tools [Aug ’26] (Media Downloader, Converter & Automation) Self Host

shinyduo
251
View Template
Telegram Gateway
Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

INAPP
4