Deploy Discord Tickets

Discord Bot for Creating and Managing Support Ticket Channels.

Deploy Discord Tickets

tickets-mysql

mysql:8

Just deployed

/var/lib/mysql

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 by eartharoid/discord-tickets:4.0.21. It handles Discord slash commands, ticket creation UI, webhooks, dashboard requests, and ticket transcripts. It listens on port 8169, 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 official mysql: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/user on tickets-app (custom plugins, assets, and local configuration)
    • /var/lib/mysql on tickets-mysql (MySQL database storage)
  • Discord Bot Credentials: DISCORD_TOKEN and DISCORD_SECRET created in the Discord Developer Portal
  • Super Admin User ID: SUPER set 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
ServiceImageRolePortVolume Mount
tickets-appeartharoid/discord-tickets:4.0.21Support Bot & Web Dashboard8169/home/container/user
tickets-mysqlmysql:8Relational Database Backend3306/var/lib/mysql

Topology
ServiceRoleVolumePublicNotes
tickets-appDiscord Support Bot & Web UI/home/container/userYes (Port 8169)Outbound Discord Gateway + Web UI/Transcripts
tickets-mysqlMySQL Database/var/lib/mysqlTCP Proxy (Port 3306)Private connection via ${{tickets-mysql.RAILWAY_PRIVATE_DOMAIN}}
Volumes (drives) — what to mount
ServiceMount pathWhat is stored
tickets-app/home/container/userApplication settings, custom assets, uploads, and local plugin/data storage
tickets-mysql/var/lib/mysqlMySQL database state, table indexes, tickets, and user permissions

Warning: Do not remove or detach the volume mounts on either service. Deleting /var/lib/mysql will permanently wipe all ticket records, while deleting /home/container/user resets application state.


Quick Start
  1. Click the Deploy on Railway button above.
  2. Sign in (or create a free Railway account).
  3. 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 bot and applications.commands scopes, select Administrator or required permissions, and invite the bot to your Discord server.
  4. Retrieve your Discord User ID:
    • Enable Developer Mode in Discord settings, right-click your profile picture, and click Copy User ID.
  5. 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.
  6. Click Deploy.
  7. Once deployed, click the public domain URL generated for tickets-app to access your Discord Tickets dashboard and transcript server.

Configuration
Discord Tickets Variables (tickets-app)
VariableDefault / SourceDescription / Notes
DISCORD_TOKEN(Required)Discord Bot Token from Discord Developer Portal
DISCORD_SECRET(Required)Discord OAuth2 Application Client Secret
SUPERYOUR_DISCORD_USER_IDDiscord User ID granted Super Admin rights over the bot
DB_PROVIDERmysqlDatabase driver identifier
DB_CONNECTION_URLAuto-configured MySQL URLPrivate connection string to tickets-mysql
ENCRYPTION_KEYAuto-generated (48 chars)Key used for encrypting sensitive data
HTTP_EXTERNALhttps://${{RAILWAY_PUBLIC_DOMAIN}}External URL used for web dashboards and ticket transcript links
HTTP_HOST0.0.0.0Bind IP host inside the container
HTTP_PORT8169Port used for the internal HTTP web server
HTTP_TRUST_PROXYtrueSet to true to trust Railway reverse proxy headers
PUBLIC_BOTfalseWhether to allow other servers to invite/use the bot
PUBLISH_COMMANDStrueAutomatically registers global Discord slash commands on startup
PORT8169Railway HTTP routing target port
MySQL Variables (tickets-mysql)
VariableDefault / SourceDescription / Notes
MYSQL_DATABASEticketsName of default MySQL database
MYSQL_USERticketsDatabase application username
MYSQL_PASSWORDAuto-generated secret (32 chars)Application user password
MYSQL_ROOT_PASSWORDAuto-generated secret (32 chars)Root administrative database password
DATABASE_URLMySQL connection stringInternal private network connection URL

Custom Domain
  1. Open the tickets-app service → Settings → Networking → Custom Domain.
  2. Add your custom domain and follow Railway’s DNS configuration instructions.
  3. Update the HTTP_EXTERNAL environment variable to match your custom domain URL (e.g. https://tickets.yourdomain.com).
  4. Railway provisions TLS automatically.

Updating Discord Tickets
  1. Open the tickets-app service → Settings → Source.
  2. Update the image tag (e.g., eartharoid/discord-tickets:4.0.21 to a newer tag).
  3. 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 SUPER Variable — Forgetting to replace YOUR_DISCORD_USER_ID with your actual numeric Discord User ID will prevent you from accessing administrative bot commands or web dashboard controls.
  • HTTP_EXTERNAL Domain Mismatch — Ensure HTTP_EXTERNAL matches 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-app may attempt to connect before MySQL has completed initialization. Railway automatically restarts tickets-app until MySQL is healthy.
  • Missing Volume Mounts — Detaching /var/lib/mysql or /home/container/user will 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:8

More templates in this category

View Template
NEW
Swarm
Named LLM bots join channels, take jobs, run routines on your Railway box

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

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

shinyduo
299