Railway

Deploy Telegram MTProto Proxy

[Jun'26] Run your own private Telegram MTProto proxy in minutes.

Deploy Telegram MTProto Proxy

/data

Deploy and Host Self-Hosted Telegram MTProto Proxy on Railway

Self-Hosted Telegram MTProto Proxy lets you run a private Telegram proxy server using Telegram's native MTProto protocol. This template uses the official telegrammessenger/proxy container and keeps the proxy configuration persistent with Railway volume storage.

About Hosting Self-Hosted Telegram MTProto Proxy

Hosting a Telegram MTProto Proxy means running a lightweight TCP-based proxy service that Telegram clients can connect to directly. It does not run a web dashboard, REST API, or normal HTTP application. Instead, it listens for MTProto traffic and forwards Telegram client connections through your deployed proxy service.

This template is designed for a simple self-hosted setup: deploy the container, attach persistent storage, enable Railway TCP Proxy, then use the generated TCP hostname, port, and secret to create your Telegram proxy link.

Common Use Cases

  • Run a private Telegram MTProto proxy
  • Create a lightweight Telegram connection fallback
  • Host a persistent Telegram proxy without managing a VPS
  • Use Railway TCP Proxy for a raw TCP-based Telegram service

Dependencies for Self-Hosted Telegram MTProto Proxy Hosting

  • Railway TCP Proxy
  • Persistent volume mounted to /data
  • MTProto proxy secret
  • Official Telegram MTProto proxy container

Deployment Dependencies

This template uses the official Telegram Messenger proxy image:

telegrammessenger/proxy:latest

Required Configuration

Persistent Volume

Mount a Railway volume to:

/data

The volume keeps generated proxy data and configuration persistent across redeployments. Without persistent storage, the proxy configuration may change after redeploying the service.

Environment Variables

Set the following variable:

SECRET="${{secret(16)}}"

SECRET is used as the MTProto proxy secret. Keep this value private because it is required when creating the Telegram proxy connection link.

Networking Setup

Telegram MTProto Proxy uses raw TCP traffic, not standard HTTP or HTTPS routing.

After deployment, enable Railway TCP Proxy and point it to the internal proxy port:

Internal Port: 443

Railway will generate a TCP proxy endpoint in this format:

your-service.proxy.rlwy.net:12345

Use the generated TCP hostname and TCP port when adding the proxy to Telegram.

Telegram Proxy Link Format

After enabling Railway TCP Proxy, create your Telegram proxy link using this format:

https://t.me/proxy?server=YOUR_TCP_PROXY_HOST&port=YOUR_TCP_PROXY_PORT&secret=YOUR_SECRET

Example:

https://t.me/proxy?server=your-service.proxy.rlwy.net&port=12345&secret=your-secret-value

Replace the following values:

YOUR_TCP_PROXY_HOST
YOUR_TCP_PROXY_PORT
YOUR_SECRET

with the values from your Railway deployment.

Important Notes

This template does not expose a web interface.

Do not use the normal Railway HTTP public domain for Telegram client connections. Telegram MTProto Proxy requires Railway TCP Proxy because it uses Telegram's native TCP-based MTProto protocol.

If the proxy connection does not work, check that Railway TCP Proxy is enabled and that the internal port is set to 443.

Why Deploy Self-Hosted Telegram MTProto Proxy 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 Self-Hosted Telegram MTProto Proxy on Railway, you can run a private Telegram MTProto proxy with persistent storage and TCP exposure without manually provisioning a VPS, configuring firewall rules, or managing low-level server setup.


Template Content

More templates in this category

View Template
Rocky Linux
[Jun'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
15
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
70
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
44