Deploy Discord Tickets
Discord Bot for Creating and Managing Support Ticket Channels.
tickets-mysql
Just deployed
/var/lib/mysql
tickets-app
Just deployed
/home/container/user
Deploy and Host Discord Tickets on Railway
Discord Tickets (by eartharoid) is a highly customizable, open-source Discord bot for managing support tickets within your Discord server. This Railway template deploys a two-tier architecture featuring the Discord Tickets Application (tickets-app) paired with a dedicated MySQL 8 Database (tickets-mysql) for persistent data storage.
About Hosting Discord Tickets
Hosting Discord Tickets on Railway deploys a multi-container stack:
- Discord Tickets App (
tickets-app): The core application and Discord bot daemon powered byeartharoid/discord-tickets:4.0.21. It handles Discord slash commands, ticket creation UI, webhooks, dashboard requests, and ticket transcripts. It listens on port8169, connects to MySQL via Railway's private network, and mounts a persistent volume at/home/container/user. - MySQL Database (
tickets-mysql): Dedicated database container using officialmysql:8. It stores server configurations, ticket categories, transcripts, user permissions, and panel settings, mounting a persistent volume at/var/lib/mysql.
Common Use Cases
- Discord Server Support Systems: Allow community members to open private support tickets with staff via interactive Discord buttons and select menus.
- HTML Ticket Transcripts: Generate and host web-based HTML transcripts of closed support tickets for auditing and record-keeping.
- Custom Staff Role Routing: Automatically route support tickets to specific staff roles or departments based on category selection.
- Multi-Guild & Custom Bot Management: Host a fully self-hosted, unbranded support bot under your own custom Discord bot application.
Dependencies for Discord Tickets Hosting
- Discord Tickets image:
eartharoid/discord-tickets:4.0.21 - MySQL image:
mysql:8 - Two persistent volumes:
/home/container/userontickets-app(custom plugins, assets, and local configuration)/var/lib/mysqlontickets-mysql(MySQL database storage)
- Discord Bot Credentials:
DISCORD_TOKENandDISCORD_SECRETcreated in the Discord Developer Portal - Super Admin User ID:
SUPERset to your Discord User Snowflake ID - Auto-generated secrets: Encryption key (
ENCRYPTION_KEY) and MySQL passwords
Upstream: Discord Tickets Documentation · GitHub (eartharoid/discord-tickets) · Docker Hub
Implementation Details
| Service | Image | Role | Port | Volume Mount |
|---|---|---|---|---|
| tickets-app | eartharoid/discord-tickets:4.0.21 | Support Bot & Web Dashboard | 8169 | /home/container/user |
| tickets-mysql | mysql:8 | Relational Database Backend | 3306 | /var/lib/mysql |
Topology
| Service | Role | Volume | Public | Notes |
|---|---|---|---|---|
| tickets-app | Discord Support Bot & Web UI | /home/container/user | Yes (Port 8169) | Outbound Discord Gateway + Web UI/Transcripts |
| tickets-mysql | MySQL Database | /var/lib/mysql | TCP Proxy (Port 3306) | Private connection via ${{tickets-mysql.RAILWAY_PRIVATE_DOMAIN}} |
Volumes (drives) — what to mount
| Service | Mount path | What is stored |
|---|---|---|
| tickets-app | /home/container/user | Application settings, custom assets, uploads, and local plugin/data storage |
| tickets-mysql | /var/lib/mysql | MySQL database state, table indexes, tickets, and user permissions |
Warning: Do not remove or detach the volume mounts on either service. Deleting
/var/lib/mysqlwill permanently wipe all ticket records, while deleting/home/container/userresets application state.
Quick Start
- Click the Deploy on Railway button above.
- Sign in (or create a free Railway account).
- Create a Discord Application & Bot:
- Go to the Discord Developer Portal.
- Click New Application, name it (e.g.
Support Tickets), and copy the Client Secret (DISCORD_SECRET). - Navigate to the Bot tab, click Reset Token, and copy the Bot Token (
DISCORD_TOKEN). - Enable required Privileged Gateway Intents (specifically Server Members Intent and Message Content Intent).
- Under OAuth2 → URL Generator, select
botandapplications.commandsscopes, select Administrator or required permissions, and invite the bot to your Discord server.
- Retrieve your Discord User ID:
- Enable Developer Mode in Discord settings, right-click your profile picture, and click Copy User ID.
- Fill in the required variables during deployment:
DISCORD_TOKEN: Your Discord Bot Token.DISCORD_SECRET: Your Discord OAuth2 Client Secret.SUPER: Your Discord User ID.
- Click Deploy.
- Once deployed, click the public domain URL generated for
tickets-appto access your Discord Tickets dashboard and transcript server.
Configuration
Discord Tickets Variables (tickets-app)
| Variable | Default / Source | Description / Notes |
|---|---|---|
DISCORD_TOKEN | (Required) | Discord Bot Token from Discord Developer Portal |
DISCORD_SECRET | (Required) | Discord OAuth2 Application Client Secret |
SUPER | YOUR_DISCORD_USER_ID | Discord User ID granted Super Admin rights over the bot |
DB_PROVIDER | mysql | Database driver identifier |
DB_CONNECTION_URL | Auto-configured MySQL URL | Private connection string to tickets-mysql |
ENCRYPTION_KEY | Auto-generated (48 chars) | Key used for encrypting sensitive data |
HTTP_EXTERNAL | https://${{RAILWAY_PUBLIC_DOMAIN}} | External URL used for web dashboards and ticket transcript links |
HTTP_HOST | 0.0.0.0 | Bind IP host inside the container |
HTTP_PORT | 8169 | Port used for the internal HTTP web server |
HTTP_TRUST_PROXY | true | Set to true to trust Railway reverse proxy headers |
PUBLIC_BOT | false | Whether to allow other servers to invite/use the bot |
PUBLISH_COMMANDS | true | Automatically registers global Discord slash commands on startup |
PORT | 8169 | Railway HTTP routing target port |
MySQL Variables (tickets-mysql)
| Variable | Default / Source | Description / Notes |
|---|---|---|
MYSQL_DATABASE | tickets | Name of default MySQL database |
MYSQL_USER | tickets | Database application username |
MYSQL_PASSWORD | Auto-generated secret (32 chars) | Application user password |
MYSQL_ROOT_PASSWORD | Auto-generated secret (32 chars) | Root administrative database password |
DATABASE_URL | MySQL connection string | Internal private network connection URL |
Custom Domain
- Open the tickets-app service → Settings → Networking → Custom Domain.
- Add your custom domain and follow Railway’s DNS configuration instructions.
- Update the
HTTP_EXTERNALenvironment variable to match your custom domain URL (e.g.https://tickets.yourdomain.com). - Railway provisions TLS automatically.
Updating Discord Tickets
- Open the tickets-app service → Settings → Source.
- Update the image tag (e.g.,
eartharoid/discord-tickets:4.0.21to a newer tag). - Click Redeploy.
All database records in tickets-mysql and user configuration files in /home/container/user remain secure across redeployments.
Traps
Common pitfalls and failure modes:
- Missing Gateway Intents — Discord Tickets requires Server Members Intent and Message Content Intent to be enabled under the Bot tab in the Discord Developer Portal. If disabled, slash commands or member lookups will fail.
- Unchanged
SUPERVariable — Forgetting to replaceYOUR_DISCORD_USER_IDwith your actual numeric Discord User ID will prevent you from accessing administrative bot commands or web dashboard controls. HTTP_EXTERNALDomain Mismatch — EnsureHTTP_EXTERNALmatches your Railway public domain or custom domain. Mismatched URLs will result in broken ticket transcript links or failed OAuth authentication.- Database Startup Delay — On cold boots,
tickets-appmay attempt to connect before MySQL has completed initialization. Railway automatically restartstickets-appuntil MySQL is healthy. - Missing Volume Mounts — Detaching
/var/lib/mysqlor/home/container/userwill result in permanent loss of support tickets, transcripts, and custom settings.
Why Deploy Discord Tickets on Railway?
Railway provides private inter-service networking, persistent volume mounts, automated HTTPS certificate management, and continuous uptime. Deploying Discord Tickets on Railway delivers an enterprise-grade support ticket infrastructure for your Discord server with zero local maintenance.
Template Content
tickets-mysql
mysql:8tickets-app
eartharoid/discord-tickets:4.0.21DISCORD_TOKEN
Discord bot token used to authenticate and connect the application to Discord.
DISCORD_SECRET
Secret used by the application for Discord authentication or integration.
