Setup Guide

Telegram Proxy on Linux: Desktop, CLI and Self-Hosted Tips

Configure MTProto on Telegram Desktop for Linux and the Telegram CLI clients (telegram-cli, tdlib), with systemd persistence.

Linux Telegram clients overview

Linux users typically run one of three clients: the official Telegram Desktop AppImage from telegram.org, the Snap or Flatpak distribution available in most package managers, or a CLI client like telegram-cli or a tdlib-based bot. All three support MTProto proxies, but the configuration mechanism differs slightly between GUI and CLI.

GUI: Telegram Desktop on Linux

Whether you installed Telegram via AppImage, Flatpak or your distro's package manager, the proxy UI is identical. Open Telegram, click the hamburger menu, then Settings → Advanced → Connection type → Use custom proxy. Choose MTProto, paste server / port / secret. The connection becomes active immediately. On Wayland desktops you may need to relaunch Telegram if you change the proxy while a chat is open — there is a known bug where the connection indicator does not update until the window is recreated.

Get a free TGFast proxy

Browse the live country grid on the home page and tap any card to connect Telegram in one second — no signup, no logs.

Open the fleet

Flatpak sandbox and DNS

If you installed Telegram from Flatpak, the sandbox blocks raw socket DNS by default. This usually does not affect MTProto proxies (which use TCP only), but if you experience strange "connecting…" loops, grant the Flatpak network access with: flatpak override --user --share=network org.telegram.desktop. Restart Telegram afterwards.

CLI: telegram-cli with proxy

For the legacy telegram-cli, pass the proxy via command line: telegram-cli --proxy=mtproto://USER:SECRET@HOST:PORT where SECRET is the hex secret with the leading "dd" stripped if you want anonymous mode. For tdlib-based bots, set the proxy with td::Td::set_option("proxy", ...) in your code, or use the higher-level helpers in tdlib bindings (Python, Rust, JS).

Stay updated

Join @FastTGProxyMT for instant alerts when servers move or new proxies launch.

Join Telegram Channel

systemd service for persistent CLI bots

If you run a Telegram bot via tdlib on a Linux server, wrap it in a systemd unit so the proxy is reapplied automatically on reboot. Create /etc/systemd/system/mybot.service with the appropriate ExecStart, Restart=always, and an Environment line containing your selected TGFast server. The bot will reconnect through the proxy within seconds of the network coming up, which is critical for hosted servers in Iran or Russia where direct TG access is unreliable.

Performance considerations

On a low-powered ARM SBC (Raspberry Pi 4, Zero 2W) the proxy adds about 1% CPU usage during active chat. On a modern x86 server it is unmeasurable. Memory overhead is under 1 MB regardless of platform. If you are running multiple bots, point them all at the same TGFast proxy — there is no per-connection limit and using a single tunnel keeps your firewall rules simple.

Troubleshooting Linux-specific quirks

If you are on a distro with strict iptables defaults (e.g. CentOS Stream, RHEL with firewalld), make sure outbound TCP to the high port range is allowed: firewall-cmd --permanent --add-port=YOUR_PORT-58000/tcp then reload. On Ubuntu with UFW, no action is normally required because outbound is allowed by default. If you use SELinux in enforcing mode and run telegram-cli from a non-standard path, you may need to set the right context with chcon -t bin_t /opt/telegram/telegram-cli.

Frequently Asked Questions

Under 60 seconds for most users. Tap any "Connect Now" button on a TGFast proxy card while reading on your phone, and Telegram will open with a single confirmation prompt — no copying, no typing, no signup. Manual configuration via Settings → Data and Storage takes around two minutes.
No. End-to-end encryption for Secret Chats is performed by your Telegram client and the recipient's client — the proxy server only forwards already-encrypted bytes. The proxy cannot read messages, see attachments, or alter content; it sees only that an MTProto session is in flight.
In most regions added latency is 30–80 ms, which is invisible for chat and barely noticeable for voice calls. In censored regions Telegram often feels faster through TGFast because direct connections suffer from forced packet loss; the proxy sidesteps that throttling entirely.
No. Proxy configuration is stored in your Telegram account profile, not in the binary, so it survives app updates, OS upgrades, and even reinstalls when you sign in with the same number. The only time you need to re-add it is if you wipe app data or sign out fully.
Yes — Telegram supports multiple saved proxies. Add a handful of TGFast servers (our proxy fleet) under Settings → Data and Storage → Proxy and toggle "use a TGFast proxy" on. Telegram will automatically fall back to the next reachable entry if the active one stops responding, giving you near-100% uptime.
Three usual causes: (1) the wrong port was typed during manual entry — recheck against the value on this page; (2) your firewall/router blocks high-numbered ports — try a different TGFast server; (3) the secret was pasted with an invisible space — copy directly from the card and paste fresh. The one-tap "Connect Now" button avoids all three issues.
Connect Telegram Proxy Now