Telegram’s MTProto Proxy allows users to bypass network restrictions and access the messaging app securely. Hosting your own private MTProto proxy on a Linux VPS ensures you have a fast, dedicated connection without relying on public proxies that are often congested or monitored.
By deploying your proxy on a FlashRDP Linux VPS, you benefit from our 1 Gbps Unmetered* Network and low-latency transit, ensuring your Telegram calls and media downloads are lightning-fast.
Prerequisites
Before starting, ensure you have:
- A deployed FlashRDP Linux VPS (Ubuntu 22.04 or Debian 12 is recommended).
- Connected to your server via SSH with
root privileges.
Step 1: Install Docker
The easiest and most secure way to run an MTProto Proxy is by using Docker. If you don’t have Docker installed on your VPS, run the following commands:
apt update
apt install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Step 2: Generate a Secret Key
Your proxy needs a 32-character hexadecimal secret key to authenticate users. You can easily generate a random, secure key using the Linux terminal:
head -c 16 /dev/urandom | xxd -p
Copy the 32-character string that is printed to your screen. You will need it in the next step.
Step 3: Deploy the Proxy Container
We will use the official Telegram MTProto proxy Docker image. Run the command below, replacing YOUR_SECRET_KEY with the 32-character string you generated.
You can also change the port -p 443:443 if you prefer to use a different port (like 8443), but 443 is recommended as it mimics standard HTTPS traffic.
docker run -d -p 443:443 --name=mtproto-proxy --restart=always \
-v proxy-config:/data \
-e SECRET=YOUR_SECRET_KEY \
telegrammessenger/mtproto-proxy:latest
What does --restart=always do? This ensures that if your server is rebooted (for example, after a kernel update), your MTProto proxy will automatically start back up without any manual intervention.
Step 4: Retrieve Your Invite Link
To connect to your proxy, you need an invite link formatted specifically for Telegram. To view the connection link generated by your container, check the Docker logs:
docker logs mtproto-proxy
In the output, you will see a block of text containing your connection links. It will look similar to this:
[+] Telegram Proxy:
[+] tg://proxy?server=YOUR_SERVER_IP&port=443&secret=YOUR_SECRET_KEY
[+] https://t.me/proxy?server=YOUR_SERVER_IP&port=443&secret=YOUR_SECRET_KEY
Step 5: Connect in Telegram
- Copy the
https://t.me/proxy?... link from your logs.
- Send this link to your saved messages in Telegram, or paste it into a web browser on a device with Telegram installed.
- Telegram will prompt you to “Connect to Proxy”.
- Click Connect Proxy, and your app will instantly route its traffic through your FlashRDP server.
Related Articles