Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Telegram mtproto proxy docker


Telegram mtproto proxy docker


Telegram MTProto Proxy with Docker

Telegram's MTProto proxy allows you to set up a proxy server that speaks Telegram's native MTProto protocol. Here's how you can deploy it using Docker:

Pull the Official Image

The official Telegram MTProto proxy Docker image can be pulled from Docker Hub:

bash
docker pull telegrammessenger/proxy

This pulls the latest release of the MTProto proxy[6].

Start a Container

To start the proxy container, run:

bash
docker run -d -p443 --name mtproxy telegrammessenger/proxy

This starts the proxy on port 443 of the host[1].

Configure Custom Settings (Optional)

If needed, you can customize the proxy settings by passing environment variables to the container:

- `SECRET`: Specify a custom 16-byte secret in lowercase hexadecimal[1]
- `WORKERS`: Set the number of worker processes[3]

For example:

bash
docker run -d -p443 -e SECRET=00baadf00d15abad1deaa51sbaadcafe telegrammessenger/proxy

Register the Proxy

After starting the proxy, go to @MTProxybot on Telegram to register your proxy and gain access to usage statistics and monetization[1].

Monitoring

The MTProto proxy exports internal statistics over the `https://localhost:2398/stats` endpoint, which can be accessed using `docker exec`[1].

That's it! With just a few Docker commands, you can easily deploy a Telegram MTProto proxy. For more advanced configurations, you can use Docker Compose or build the image from source[2][3].

Citations:
[1] https://git.esin.io/github/across/commit/11440fab176db73640c4ea3b87cb0b6a9390314f?style=unified&whitespace=ignore-all
[2] https://github.com/iShift/docker-compose-mtproxy
[3] https://github.com/Dofamin/MTProxy-Docker
[4] https://www.youtube.com/watch?v=_cCI4ksKp7I
[5] https://gitlab.com/-/snippets/2432347
[6] https://hub.docker.com/r/telegrammessenger/proxy/
[7] https://hub.docker.com/r/seriyps/mtproto-proxy
[8] https://hub.docker.com/r/scavin/telegram-mtproto-proxy