---
title: "Deploy Discord Bot Starter"
description: "A discord.js bot template written with TypeScript."
category: "Bots"
url: https://railway.com/deploy/discord-bot-starter
---

# Deploy Discord Bot Starter

A discord.js bot template written with TypeScript.

**[Deploy Discord Bot Starter on Railway](https://railway.com/template/discord-bot-starter)**

- **Category:** Bots
- **Total deploys:** 1

## Template content

### MongoDB https://devicons.railway.app/i/mongodb.svg

- **Image:** mongo:8.0
- **Start command:** `docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 --setParameter diagnosticDataCollectionEnabled=false`

### discord-bot-starter

- **Source:** arloodots/discord-bot-starter
- **Public domain:** Yes

## Documentation

# 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:

```env
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:

```env
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`

3. Under **Bot Permissions**, choose the permissions your bot requires (for example, Send Messages, Read Message History, Manage Messages, etc.).

4. Copy the generated invitation URL.

5. Open the URL in your browser.

6. Select your Discord server.

7. Click **Authorize**.

8. 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.

## Similar templates

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Aug ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Aug ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/discord-bot-starter
