Deploy T3rmx sours
Deploy your own Telegram UserBot with PostgreSQL
worker
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host T3rmx UserBot on Railway
Deploy your own independent Telegram UserBot using T3rmx UserBot. This template provisions an application service and a dedicated PostgreSQL database on Railway. Each deployment uses its own Telegram credentials, owner configuration, and database, allowing users to operate independent instances without sharing the original project owner's private credentials or data.
About Hosting
T3rmx UserBot is a Telegram automation and userbot project built with Python and Telethon. This Railway template uses the repository's Dockerfile to build and run the application, alongside a dedicated PostgreSQL service for persistent data storage.
Each deployment is designed to have its own application instance and PostgreSQL database. Railway service reference variables connect the application to its database without requiring users to copy database credentials manually.
Users must provide their own Telegram API credentials, Telegram session, bot token, bot username, and owner ID during deployment. No personal Telegram credentials or production database are included in the template.
Why Deploy
Deploying T3rmx UserBot on Railway simplifies the infrastructure setup:
- Automated application deployment using Docker.
- PostgreSQL provisioned as a separate service.
- Database connection configured through Railway reference variables.
- Independent configuration for every deployment.
- No need to manually install Python dependencies or configure a Linux server.
- Centralized deployment logs, environment variables, and service management.
Common Use Cases
- Running a personal Telegram UserBot with your own Telegram account.
- Deploying an independent instance for a separate Telegram account.
- Building and testing Telegram automation workflows.
- Running a customized UserBot without managing your own VPS.
- Hosting a Telegram automation project with persistent PostgreSQL storage.
Dependencies for T3rmx UserBot Hosting
- Python runtime and project dependencies installed through the Dockerfile.
- Telethon for Telegram API communication.
- PostgreSQL for persistent application data.
- Railway application service and PostgreSQL service.
- Telegram API credentials and an authorized Telegram session supplied by the deployer.
Deployment Dependencies
Before deploying, prepare your own:
- Telegram API ID: https://my.telegram.org
- Telegram API Hash: https://my.telegram.org
- Telegram String Session generated from your own Telegram account.
- Telegram Bot Token obtained from @BotFather.
- Telegram Bot Username.
- Telegram Owner ID.
The template requires these application variables:
STRING_SESSIONAPP_IDAPI_HASHTG_BOT_TOKENTG_BOT_USERNAMET3RMX_OWNER_ID
DATABASE_URL should reference the PostgreSQL service provisioned for the same deployment.
Optional configuration:
ALIVE_NAME— defaults toT3rmx UserBot.TZ— defaults toUTC.ENV— defaults toproduction.COMMAND_HAND_LER— command prefix configuration.SUDO_COMMAND_HAND_LER— sudo command prefix configuration.VCMODE— voice chat mode configuration.VC_SESSION— optional voice chat session configuration.
Never reuse another deployment's Telegram session, bot token, API credentials, or database connection.
Security and Privacy
Every deployer must use their own Telegram credentials and session. Keep all credentials private and configure them through Railway environment variables. Never commit secrets to GitHub or include personal production data in a public template.
Implementation Details
- Source repository: https://github.com/T3rmx/T3rmx-UserBot
- Build configuration: Dockerfile
- Application startup:
python3 -m JoKeRUB - Database: Railway PostgreSQL
- Database configuration:
DATABASE_URL - Health check configuration:
/health(requires the application HTTP endpoint to be available).
Only deploy after reviewing the environment variables and confirming that the application and database are correctly connected.
Template Content
worker
T3rmx/T3rmx-UserBotAPP_ID
Your Telegram API application ID from https://my.telegram.org.
API_HASH
Your Telegram API application hash from https://my.telegram.org.
TG_BOT_TOKEN
Your Telegram bot token obtained from @BotFather.
STRING_SESSION
Your personal Telegram user session string. Generate your own session and keep it private.
T3RMX_OWNER_ID
Your numeric Telegram user ID authorized to control this UserBot instance.
TG_BOT_USERNAME
Your Telegram bot username without the @ prefix.
PGDATA
PostgreSQL data directory used internally by the database service.
PGPORT
PGPORT Port used by the PostgreSQL database service.
POSTGRES_DB
Initial database name configured for PostgreSQL.
POSTGRES_USER
Initial PostgreSQL database username.
SSL_CERT_DAYS
Validity period in days for the PostgreSQL SSL certificate.
RAILWAY_DEPLOYMENT_DRAINING_SECONDS
Grace period in seconds for Railway deployment draining.
