
Deploy Discord Bot Starter
A discord.js bot template written with TypeScript.
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
| Dependency | Required | Purpose |
|---|---|---|
| Discord Bot Token | Yes | Authenticates your bot with Discord. |
Deployment Dependencies
| Resource | Link |
|---|---|
| GitHub Repository | https://github.com/threeal/discord-bot-starter |
| Discord Developer Portal | https://discord.com/developers/applications |
| Sapphire Framework Documentation | https://www.sapphirejs.dev |
| Discord Developer Documentation | https://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.
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN | Yes | Your 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.
-
Visit the Discord Developer Portal: https://discord.com/developers/applications
-
Click New Application.
-
Enter an application name and click Create.
-
From the sidebar, select Bot.
-
Click Add Bot, then confirm.
-
Under the Bot section, click Reset Token (or Copy Token if already generated).
-
Copy the generated Bot Token.
-
In Railway, open your service and navigate to Variables.
-
Add:
DISCORD_TOKEN=your_bot_token
Inviting the Bot to Your Server
After creating the bot:
-
Open the OAuth2 → URL Generator page.
-
Under Scopes, select:
botapplications.commands
-
Under Bot Permissions, choose the permissions your bot requires (for example, Send Messages, Read Message History, Manage Messages, etc.).
-
Copy the generated invitation URL.
-
Open the URL in your browser.
-
Select your Discord server.
-
Click Authorize.
-
Complete the CAPTCHA if prompted.
The bot will now join your Discord server.
Using the Bot
Once deployed:
- Verify the deployment completed successfully in Railway.
- Open Deploy Logs to confirm the bot connected successfully.
- Open your Discord server.
- The bot should appear online.
- Use the configured slash commands (such as
/) to interact with the bot. - Modify the files inside the
srcdirectory 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
discord-bot-starter
arloodots/discord-bot-starterDISCORD_BOT_TOKEN
Your Discord bot token from the Developer Portal.
