RU RU

Case: Launching and Registering an MTProto Proxy in 5 Minutes Using Docker

Published on 2025-10-01


Case: Launching and Registering an MTProto Proxy in 5 Minutes Using Docker

Problem

In some regions, access to Telegram may be unstable or completely blocked. Using public proxies or VPNs is not always convenient: they can be slow, overloaded, or also blocked.

Task

🚀 Create your own fast and reliable proxy, register it in Telegram to track statistics, and optionally make it public.


Solution Choice: Docker + Official MTProto Image

  • Why Docker? Docker allows you to run the proxy in an isolated container without installing unnecessary dependencies on the server. It’s clean, secure, and incredibly fast. The docker-compose.yml file describes the entire configuration in one place, making the launch and management process trivial.

  • Why telegrammessenger/proxy? This is the official, verified image from the Telegram team. It’s optimized, stable, and uses the MTProto protocol, specifically designed to work under restrictions and traffic obfuscation.


⚙️ Implementation: Breakdown of docker-compose.yml

services:
  mtproto:
    # 1. Image
    image: telegrammessenger/proxy:latest
    container_name: mtproto

    # 2. Restart policy
    restart: unless-stopped

    # 3. Port mapping
    ports:
      - "443:443/tcp"

    # 4. Environment configuration
    environment:
      # IMPORTANT: SECRET must be a 32-character hex key!
      - SECRET=dd000102030405060708090a0b0c0d0e0f

    # 5. Data persistence
    volumes:
      - proxy-config:/data

volumes:
  proxy-config:

Key Points Breakdown

  1. Image: uses the official telegrammessenger/proxy:latest.

  2. Auto-restart: restart: unless-stopped ensures the proxy recovers after a crash or server reboot.

  3. Port 443: traffic goes through the standard HTTPS port, making blocking harder.

  4. SECRET: a unique 32-character hex key. You can generate it with the command:

    head -c 16 /dev/urandom | xxd -ps
    

    It’s recommended to add the prefix dd for obfuscation.

  5. Volume proxy-config: stores settings and statistics between restarts.


Launch and Usage

  1. Save the configuration in a file docker-compose.yml.

  2. Launch the proxy:

    docker-compose up -d
    
  3. Generate a connection link:

    tg://proxy?server=YOUR_IP_ADDRESS&port=443&secret=YOUR_SECRET
    

    Example:

    tg://proxy?server=123.45.67.89&port=443&secret=dd000102030405060708090a0b0c0d0e0f
    

    When you open this link, Telegram will automatically prompt you to add the proxy.


📢 Step 5: Registering the Proxy via Bot

To receive usage statistics and possibly be listed in public directories, you need to register your proxy in Telegram.

  1. Find the bot: open Telegram and search for the official bot @MTProxybot.

  2. Start registration: send the command /newproxy to the bot.

  3. Provide host and port: the bot will ask for host:port. Send your server’s IP address and port, for example:

    123.45.67.89:443
    
  4. Provide the secret: the bot will request your secret key. Send the same 32-character hex key from docker-compose.yml.

  5. Get the tag: if successful, the bot will register your proxy and provide a unique promo tag.

After registration, you can use the bot to view connection statistics and also link a sponsor channel. Users connected to your proxy will see a pinned link to your channel at the top of their chat list.


✅ Results

  • Reliability: your own controlled proxy with auto-restart.
  • Speed: limited only by your VPS performance.
  • Security: traffic is disguised as HTTPS, access protected by a secret key.
  • Manageability: launch takes 5 minutes, updates require just two commands.
  • Transparency: registration via bot gives you statistics and promotion opportunities through a sponsor channel.

Related reviews

I needed to get n8n, Redis, and the database working. I had hired another contractor before and everything kept breaking. I hired Mikhail, and the next day everything was working quickly, like clockwork!

christ_media · n8n installation on your VPS server. Configuration of n8n, Docker, AI, Telegram

Experienced buyer

2025-09-24 · ⭐ 5/5

There was a task to get n8n, redis and the database working. I had previously ordered from another contractor, it kept breaking all the time. Ordered from Mikhail, the next day everything started working fast, like clockwork!

Quick solution — I highly recommend Mikhail as a contractor! I tried to build a similar configuration myself and even followed AI advice, which ended up costing a lot of time and money (due to server downtime). So my advice: hire professionals — it's cheaper =) Thanks to Mikhail for his professionalism.

ladohinpy · n8n installation on your VPS server. Configuration of n8n, Docker, AI, Telegram.

2025-08-25 · ⭐ 5/5

Quick fix for the problem, I recommend Mikhail as a contractor to everyone! I tried to assemble a similar configuration myself and following advice from neural networks, which resulted in a lot of wasted effort and money (due to server downtime). So my advice in the end — turn to professionals, it will be cheaper =) Thanks to Mikhail for his professionalism.

Need help?

Get in touch with me and I'll help solve the problem

Related Posts