sudo apt install git curl build-essential libssl-dev zlib1g-dev -y
git clone \
  && cd MTProxy \
  && make \
  && cd objs/bin \
  && curl -s -o proxy-secret \
  && curl -s -o proxy-multi.conf

Generate a secret to be used by users to connect to your proxy:

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

Run in foreground:

./mtproto-proxy -u nobody -p 8888 -H 6443 -S  --aes-pwd proxy-secret proxy-multi.conf -M 1

Run as a service:

Create file /etc/systemd/system/MTProxy.service:


ExecStart=/opt/MTProxy/mtproto-proxy -u nobody -p 8888 -H 6443 -S  -aes-pwd /opt/MTProxy/proxy-secret /opt/MTProxy/proxy-multi.conf -M 1


/opt/MTProxy is your MTProxy file directory.

systemctl daemon-reload \
  && systemctl start MTProxy.service \
  && systemctl enable MTProxy.service

Check the status:

systemctl status MTProxy.service

Github - TelegramMessenger/MTProxy