> ## Documentation Index
> Fetch the complete documentation index at: https://flashrdp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Telegram MTProto Proxy

> Deploy a fast, secure Telegram MTProto proxy on a FlashRDP Linux VPS with Docker to bypass censorship and share access with friends or your team.

Telegram's **MTProto Proxy** allows users to bypass network restrictions and access the messaging app securely. Hosting your own private MTProto proxy on a Linux VPS ensures you have a fast, dedicated connection without relying on public proxies that are often congested or monitored.

By deploying your proxy on a [FlashRDP Linux VPS](https://flashrdp.com/linux-vps?utm_source=docs\&utm_medium=guide\&utm_campaign=mtproto), you benefit from our **1 Gbps Network** and low-latency transit, ensuring your Telegram calls and media downloads are lightning-fast.

## Prerequisites

Before starting, ensure you have:

1. A deployed FlashRDP Linux VPS (Ubuntu 22.04 or Debian 12 is recommended).
2. Connected to your server via SSH with `root` privileges.

## Step 1: Install Docker

The easiest and most secure way to run an MTProto Proxy is by using Docker. If you don't have Docker installed on your VPS, run the following commands:

```bash theme={null}
apt update
apt install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
```

## Step 2: Generate a Secret Key

Your proxy needs a 32-character hexadecimal secret key to authenticate users. You can easily generate a random, secure key using the Linux terminal:

```bash theme={null}
head -c 16 /dev/urandom | xxd -p
```

Copy the 32-character string that is printed to your screen. You will need it in the next step.

## Step 3: Deploy the Proxy Container

We will use the official Telegram MTProto proxy Docker image. Run the command below, replacing `YOUR_SECRET_KEY` with the 32-character string you generated.

You can also change the port `-p 443:443` if you prefer to use a different port (like `8443`), but `443` is recommended as it mimics standard HTTPS traffic.

```bash theme={null}
docker run -d -p 443:443 --name=mtproto-proxy --restart=always \
  -v proxy-config:/data \
  -e SECRET=YOUR_SECRET_KEY \
  telegrammessenger/mtproto-proxy:latest
```

<Tip>
  **What does `--restart=always` do?** This ensures that if your server is rebooted (for example, after a kernel update), your MTProto proxy will automatically start back up without any manual intervention.
</Tip>

## Step 4: Retrieve Your Invite Link

To connect to your proxy, you need an invite link formatted specifically for Telegram. To view the connection link generated by your container, check the Docker logs:

```bash theme={null}
docker logs mtproto-proxy
```

In the output, you will see a block of text containing your connection links. It will look similar to this:

```text theme={null}
[+] Telegram Proxy:
[+] tg://proxy?server=YOUR_SERVER_IP&port=443&secret=YOUR_SECRET_KEY
[+] https://t.me/proxy?server=YOUR_SERVER_IP&port=443&secret=YOUR_SECRET_KEY
```

## Step 5: Connect in Telegram

1. Copy the `https://t.me/proxy?...` link from your logs.
2. Send this link to your saved messages in Telegram, or paste it into a web browser on a device with Telegram installed.
3. Telegram will prompt you to "Connect to Proxy".
4. Click **Connect Proxy**, and your app will instantly route its traffic through your FlashRDP server.

## Related Articles

<CardGroup cols={2}>
  <Card title="Linux VPS Overview" icon="linux" href="/docs/linux-vps/overview" />

  <Card title="Connecting via SSH" icon="terminal" href="/docs/linux-vps/ssh-access" />

  <Card title="Self-Hosted Analytics" icon="chart-simple" href="/docs/guides/self-hosted-analytics" />
</CardGroup>
