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 fleetFlatpak 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 Channelsystemd 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.