PHPackages                             p1ratrulezzz/mtproxy-server-linux - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. p1ratrulezzz/mtproxy-server-linux

ActiveLibrary[HTTP &amp; Networking](/categories/http)

p1ratrulezzz/mtproxy-server-linux
=================================

Proxy server for MTProto (Telegram)

0.1.6(7y ago)656626[2 issues](https://github.com/p1ratrulezzz/mtproxy-server-linux/issues)AGPL-3.0PHP

Since May 25Pushed 7y ago7 watchersCompare

[ Source](https://github.com/p1ratrulezzz/mtproxy-server-linux)[ Packagist](https://packagist.org/packages/p1ratrulezzz/mtproxy-server-linux)[ RSS](/packages/p1ratrulezzz-mtproxy-server-linux/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (8)Dependencies (2)Versions (8)Used By (0)

MTProxy Server for Telegram clients
===================================

[](#mtproxy-server-for-telegram-clients)

[![Latest Stable Version](https://camo.githubusercontent.com/67af2ffa9a42a2f8905a269dcf56c199d895f689828499d5440fbc9d94de5f6b/68747470733a2f2f706f7365722e707567782e6f72672f703172617472756c657a7a7a2f6d7470726f78792d7365727665722d6c696e75782f762f737461626c65)](https://packagist.org/packages/p1ratrulezzz/mtproxy-server-linux)[![Latest Unstable Version](https://camo.githubusercontent.com/5bbd04d1d5d0f2f919f5d9b11e32cf48d51338c21322a939fa6b6f92bfe9cfb2/68747470733a2f2f706f7365722e707567782e6f72672f703172617472756c657a7a7a2f6d7470726f78792d7365727665722d6c696e75782f762f756e737461626c65)](https://packagist.org/packages/p1ratrulezzz/mtproxy-server-linux)

This is just a useful scripts for setting up your own mtprotocol proxy for telegram. Note: this proxy once created can be used by other users who you shared this proxy with and it doesn't give them access to your account, so its completely safe to use it and share with friends! Plus: Sponsored channels are coming. That means that your proxy can force your users to subscribe to some channel. This can be as a motivation to setup such a proxy.

Testing MTProto proxy servers
=============================

[](#testing--mtproto-proxy-servers)

[Python](https://github.com/alexbers/mtprotoproxy) - HIGHLY RECOMMENDED!!!
--------------------------------------------------------------------------

[](#python---highly-recommended)

#### Supports channel advertising, fully supports ipv6 and the easiest to installl!

[](#supports-channel-advertising-fully-supports-ipv6-and-the-easiest-to-installl)

Note: Requires to install python3 and python3-crypto packages via apt-get Installation of docker version:

Installation on CentOS (automatic): Check the tutorial in repo  and don't forget to star.

Easy install on CentOS command

```
wget -O - https://git.io/vhgUt | sudo -E bash -
```

Installation on Ubuntu/Debian:

```
   cd /opt
   git clone https://github.com/alexbers/mtprotoproxy.git
   cd mtprotoproxy
   apt-get install python3 python3-crypto
   ## edit config.py file with desired port and proxy tag and start! ##
   python3 mtprotoproxy.py
```

Repo:  (Star this repo and share with friends)

### C (Official Telegram MTProxy)

[](#c-official-telegram-mtproxy)

Opinions: Difficult to install. Great use of resources, supports channel advertising, works stable if was successfully installed. Doesn't work on some servers expecially on servers located at Russia (even using VPN). I do not recommend to install unless you want to advertise your channel (in this case it's better to use Python version anyway).

Note: It is a very first version so it can be quite tricky to make it work, though it is possible. Also check my fork with tutorials here  and here

Repo:

And yes. This server does have an ability to set promoted channel (check my forked repo and blogpost for tutorial)

Server #1: [https://t-do.ru/proxy?server=hrushka.peppa.dns-cloud.net&amp;port=587&amp;secret=ddace63eff7aefb133be6e72f5f57d8382](https://t-do.ru/proxy?server=hrushka.peppa.dns-cloud.net&port=587&secret=ddace63eff7aefb133be6e72f5f57d8382)

### PHP (this repo)

[](#php-this-repo)

Note: there is an issue with Android clients. It's impossible to send messages. Desktop clients work great.

Pleae, test the servers above to gather statistics on CPU load and etc. Version 0.1.6 has an issue with creating a lot of zombie forks and killing the server completely. Set memory\_limit to 32MB on your server per PHP script to save some resources.

[NodeJS](https://github.com/FreedomPrevails/JSMTProxy)
------------------------------------------------------

[](#nodejs)

Repo:

Note: if a lot of people are connected and uploading files, server will suffer from high CPU load

[Java](https://github.com/makkarpov/mtoxy)
------------------------------------------

[](#java)

Note: requires JRE 8 or JDK 8. On version 9 and higher won't work.

Repo:

Before you start installation
=============================

[](#before-you-start-installation)

Some VPS providers are blocking Telegram connections from their servers. Here is the list of these services and it will be filled in during some time, but for now there are already these ones:

- OVH
- IPhoster

Don't use these providers for your MTProto proxy server.

Installation
============

[](#installation)

The initial daemon file is in  (don't forget to Star this repo)

Tutorial for Ubuntu 16.04 Server
--------------------------------

[](#tutorial-for-ubuntu-1604-server)

1. Loggining in via SSH to your VDS as root
2. Install requirements

```
   apt-get update
   apt-get install php7.0-cli php7.0-xml php7.0-curl php7.0-opcache php7.0-zip
   apt-get install composer
   wget -O composer-setup.php https://getcomposer.org/installer && php composer-setup.php --install-dir=$(dirname $(which composer)) --filename=composer && rm composer-setup.php
```

2. Create mtproxy user

```
  useradd --shell /usr/sbin/nologin -M -u 3000 -o mtproxy
```

Note: password you set doesn't matter

3. Download a package into /opt folder

```
  cd /opt/
  composer require p1ratrulezzz/mtproxy-server-linux ^0.1
  sh vendor/p1ratrulezzz/mtproxy-server-linux/install.sh
``

After that you will see that the directory /opt/mtproto-proxy has been created.

4. Run proxy for the first time

```bash
  cd /opt/mtproto-proxy
  chmod +x mtproxyd
  ./mtproxyd marcopolo 6666
```

6666 - is the port to listen on marcopolo - is the seed to generate hashes. It is safe to leave it this way as created hash will be random anyway. But it is better toset your own seed and use for that the one of the generated from [Random.org](https://www.random.org/passwords/?num=5&len=16&format=html&rnd=new) password of any length. It might ask you to login using your existing telegram account. This is ok, just enter your phone number and then an autorization code that you will get via Telegram. This is just a one time setup.

You will see that daemon is running and it will create a file secret.txt.

```
  cat secret.txt

```

Note: you can manualy create this file and write your own 32 character string in it. In this case it won't be rewritten.

it will show you your secret password for connecting to your proxy. Something like:

```
   38f75d6bb9f8138e53489cf1b7a132ec

```

38f75d6bb9f8138e53489cf1b7a132ec - is the 32 characters secret (some kind of a password) used to auth on your proxy server. This password will be written to secret.txt file and you always can reveal it if you have root access. The easiest way to creat your own password is to use md5 hash of any of provided string using any md5 generator (online tools are also OK).

Note: the password can be set manualy. It MUST be any HEX-string (only digits and characters from range a-f and always lowercased). This key is used to encrypt your traffic using AES encryption.

Now press Ctrl+C to terminate the proxy process.

5. Check permissions for files

```
  chown -R mtproxy:mtproxy /opt/mtproto-proxy
```

6. Install a linux service to start/stop/restart and autostart proxy

```
   wget -O /etc/init.d/mtproxy 'https://raw.githubusercontent.com/p1ratrulezzz/mtproxy-server-linux/master/etc/init.d/mtproxy'
   chmod +x /etc/init.d/mtproxy
   systemctl daemon-reload
   systemctl start mtproxy
   systemctl enable mtproxy
```

And check if it is working

```
   systemctl start mtproxy
```

You should see that it is "active (running)"

```
 mtproxy.service - LSB: MTProxy service
   Loaded: loaded (/etc/init.d/mtproxy; bad; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-17 21:55:08 UTC; 1 day 9h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 16657 ExecStop=/etc/init.d/mtproxy stop (code=exited, status=0/SUCCESS)
  Process: 16752 ExecStart=/etc/init.d/mtproxy start (code=exited, status=0/SUCCESS)
    Tasks: 14
   Memory: 55.3M
      CPU: 1min 14.837s
   CGroup: /system.slice/mtproxy.service

```

Note: you should edit the file /etc/init.d/mtproxy and set your own seed and port.

7. Test your installation

- Using telegram desktop client which can be downloaded from
- Using Android client that can be downloaded from

(use Alpha release as it is the only release availalble that supports MTproto proxies)

Server: your\_domain\_name\_or\_ip\_address\_of\_vds\_server Port: 6666 Secret: secret\_from\_secret.txt\_file

Note: ip address of VDS/VPS server can be revealed by running a command

```
   curl ipinfo.io/ip
```

or (may not be usefull on servers that have internal IP but this is not our case so this should be OK)

```
   ifconfig

```

Other proxy server implementations
----------------------------------

[](#other-proxy-server-implementations)

Check this account  to see all the MTProto proxy implementations.

It is possible to use daemon script from this repo to integrate with any of these servers (except nodejs, for nodejs use pm2 upstart)

Java implementation:

Another version of installator for MTProxy (madeline driven)
------------------------------------------------------------

[](#another-version-of-installator-for-mtproxy-madeline-driven)

Check the repo:  . It provides an easy-install shell script. It installs the same version of MTProto Proxy as provided in this [repo](https://github.com/danog/MadelineProto)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

2910d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5019669?v=4)[P1ratRuleZZZ](/maintainers/p1ratrulezzz)[@p1ratrulezzz](https://github.com/p1ratrulezzz)

---

Top Contributors

[![p1ratrulezzz](https://avatars.githubusercontent.com/u/5019669?v=4)](https://github.com/p1ratrulezzz "p1ratrulezzz (87 commits)")

### Embed Badge

![Health badge](/badges/p1ratrulezzz-mtproxy-server-linux/health.svg)

```
[![Health](https://phpackages.com/badges/p1ratrulezzz-mtproxy-server-linux/health.svg)](https://phpackages.com/packages/p1ratrulezzz-mtproxy-server-linux)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
