---
title: "Deploy Telegram Proxy"
description: "Zero-config Telegram MTProto Proxy Server. Secure, fast, and reliable."
category: "Other"
url: https://railway.com/deploy/telegram-proxy
---

# Deploy Telegram Proxy

Zero-config Telegram MTProto Proxy Server. Secure, fast, and reliable.

**[Deploy Telegram Proxy on Railway](https://railway.com/template/telegram-proxy)**

- **Creator:** INF Labs
- **Category:** Other
- **Total deploys:** 9

## Template content

### proxy https://devicons.railway.app/tele

- **Image:** telegrammessenger/proxy:latest
- **Start command:** `bash -lc 'while true; do echo "$(date) - Server is active"; sleep 30; done & exec /run.sh'`

## Documentation

# Deploy and Host Telegram Proxy on Railway

Self-hosted Telegram MTProto Proxy that lets you run your own private, secure, and reliable proxy server. This template uses the official Telegram proxy image with persistent storage and Railway TCP Proxy support, so you can deploy in minutes without managing a VPS.

![Telegram Proxy](https://imgur.com/TsNXSjH.png)

## About Hosting Telegram Proxy

Hosting a Telegram MTProto Proxy on Railway gives you a private proxy that speaks Telegram’s native protocol. The template runs the official `telegrammessenger/proxy` container with persistent volume support and Railway TCP Proxy, because MTProto requires raw TCP (not HTTP).

You only need to set a few environment variables (`SECRET`, optional `WORKERS` and `TAG`). After deployment, enable TCP Proxy on port 443, generate your proxy link, and start using it in Telegram. No web dashboard, no extra services — just a clean, lightweight proxy under your full control.
## Common Use Cases
- Run a private Telegram proxy for personal use or small teams
- Bypass network restrictions with a self-hosted MTProto endpoint
- Promote your Telegram channel using the official Advertisement Tag (`TAG`)
- Avoid unreliable public proxies by hosting your own controlled instance
- Quickly test or deploy a Telegram proxy without managing a VPS or firewall
## Dependencies for Telegram Proxy Hosting
- Railway account with TCP Proxy support
- Official Telegram MTProto Proxy Docker image (`telegrammessenger/proxy`)
- Persistent volume for storing the proxy secret
- Optional: Telegram account to generate Advertisement Tag via @MTProxybot

### Deployment Dependencies
- Official Telegram Proxy image: https://hub.docker.com/r/telegrammessenger/proxy
- Railway TCP Proxy documentation
- @MTProxybot on Telegram (for generating Advertisement Tag)
### Implementation Details
After deployment:
1. Enable **Railway TCP Proxy** and set Internal Port to `443`.
2. Copy the generated TCP hostname and port.
3. Create your proxy link:
   ```
   https://t.me/proxy?server=YOUR_HOST&port=YOUR_PORT&secret=YOUR_SECRET
   ```
4. (Optional) Generate a Fake-TLS secret starting with `ee` for better DPI resistance:
   ```bash
   echo "ee$(openssl rand -hex 15)"
   ```

**Environment Variables**

| Variable | Description | Default | Required |
|----------|-------------|---------|----------|
| `SECRET` | 32-character hex secret (keep private) | Auto-generated | Yes |
| `WORKERS` | Number of worker processes | `4` | No |
| `TAG` | Advertisement tag from @MTProxybot | empty | No |

> Note: The `TAG` is not persistent and must be re-set after every redeploy.

### How to Get a TAG (Advertisement Tag)
1. Deploy the proxy first and copy your `SECRET`.
2. Open Telegram and search for **@MTProxybot**.
3. Send the command `/newproxy`.
4. Input your Railway TCP Proxy hostname, port, and your `SECRET`.
5. The bot will reply with a `TAG` (example: `3f40462915a3e6026a4d790127b95ded`).
6. Copy the `TAG` and paste it into the `TAG` environment variable in your Railway service.
## Comparison
| Aspect                        | This Template on Railway | Manual VPS Setup       | Free Public Proxies    | Other Cloud Platforms |
|-------------------------------|--------------------------|------------------------|------------------------|-----------------------|
| Setup time                    | ✅ ~1-2 minutes          | ❌ 15-40 minutes       | ✅ Instant             | ⚠️ 5-15 minutes       |
| No server management          | ✅ Yes                   | ❌ Required            | ✅ Yes                 | ✅ Mostly             |
| Persistent storage            | ✅ Railway Volume        | ✅ Manual              | ❌ No                  | ⚠️ Varies             |
| Fully private & controlled    | ✅ Under your control    | ✅ Yes                 | ❌ Shared / risky      | ✅ Yes                |
| Performance tuning            | ✅ `WORKERS` variable    | ✅ Full control        | ❌ Limited             | ⚠️ Limited            |
| Ad tag / channel promotion    | ✅ Supported via `TAG`   | ✅ Supported           | ❌ Not available       | ⚠️ Depends on image   |
| Native TCP exposure           | ✅ Railway TCP Proxy     | ✅ Manual config       | ✅ Usually available   | ⚠️ Often limited      |
| Official Telegram image       | ✅ Yes                   | ✅ Possible            | ❌ No                  | ⚠️ Rarely             |
| Cost model                    | Pay only for usage       | Fixed monthly cost     | Free (unreliable)      | Usage-based           |
## Why Deploy Telegram 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 Telegram Proxy 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

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/telegram-proxy
