2026-04-13 09:56:44 +03:00
# Installation Options
There are three options for installing Telemt:
- [Automated installation using a script ](#very-quick-start ).
- [Manual installation of Telemt as a service ](#telemt-via-systemd ).
- [Installation using Docker Compose ](#telemt-via-docker-compose ).
2026-04-07 22:40:54 +03:00
# Very quick start
### One-command installation / update on re-run
``` bash
curl -fsSL https://raw.githubusercontent.com/telemt/telemt/main/install.sh | sh
```
2026-04-13 09:56:44 +03:00
After starting, the script will prompt for:
- Your language (1 - English, 2 - Russian);
- Your TLS domain (press Enter for petrovich.ru).
The script checks if the port (default **443 ** ) is free. If the port is already in use, installation will fail. You need to free up the port or use the * * -p** flag with a different port to retry the installation.
To modify the script’ s startup parameters, you can use the following flags:
- **-d, --domain** - TLS domain;
- **-p, --port** - server port (1– 65535);
- **-s, --secret** - 32 hex secret;
- **-a, --ad-tag** - ad_tag;
- **-l, --lan**g - language (1/en or 2/ru);
Providing all options skips interactive prompts.
After completion, the script will provide a link for client connections:
``` bash
tg://proxy?server= IP& port = PORT& secret = SECRET
```
2026-04-07 22:40:54 +03:00
### Installing a specific version
``` bash
curl -fsSL https://raw.githubusercontent.com/telemt/telemt/main/install.sh | sh -s -- 3.3.39
```
### Uninstall with full cleanup
``` bash
curl -fsSL https://raw.githubusercontent.com/telemt/telemt/main/install.sh | sh -s -- purge
```
2026-02-28 17:46:11 +03:00
# Telemt via Systemd
## Installation
This software is designed for Debian-based OS: in addition to Debian, these are Ubuntu, Mint, Kali, MX and many other Linux
**1. Download **
``` bash
wget -qO- " https://github.com/telemt/telemt/releases/latest/download/telemt- $( uname -m) -linux- $( ldd --version 2>& 1 | grep -iq musl && echo musl || echo gnu) .tar.gz " | tar -xz
```
**2. Move to the Bin folder **
``` bash
mv telemt /bin
```
**3. Make the file executable **
``` bash
chmod +x /bin/telemt
```
## How to use?
**This guide "assumes" that you: **
- logged in as root or executed `su -` / `sudo su`
- Already have the "telemt" executable file in the /bin folder. Read the * * [Installation ](#Installation )** section.
---
**0. Check port and generate secrets **
2026-03-25 17:40:45 +03:00
The port you have selected for use should not be in the list:
2026-02-28 17:46:11 +03:00
``` bash
netstat -lnp
```
2026-03-25 17:40:45 +03:00
Generate 16 bytes/32 characters in HEX format with OpenSSL or another way:
2026-02-28 17:46:11 +03:00
``` bash
openssl rand -hex 16
```
OR
``` bash
xxd -l 16 -p /dev/urandom
```
OR
``` bash
python3 -c 'import os; print(os.urandom(16).hex())'
```
Save the obtained result somewhere. You will need it later!
---
2026-03-09 19:38:55 +03:00
**1. Place your config to /etc/telemt/telemt.toml **
2026-03-25 17:40:45 +03:00
Create the config directory:
2026-03-09 19:38:55 +03:00
``` bash
mkdir /etc/telemt
```
2026-02-28 17:46:11 +03:00
Open nano
``` bash
2026-03-09 19:38:55 +03:00
nano /etc/telemt/telemt.toml
2026-02-28 17:46:11 +03:00
```
2026-03-25 17:40:45 +03:00
Insert your configuration:
2026-02-28 17:46:11 +03:00
``` toml
2026-04-08 15:52:55 +03:00
### Telemt Based Config.toml
# We believe that these settings are sufficient for most scenarios
# where cutting-egde methods and parameters or special solutions are not needed
2026-02-28 17:46:11 +03:00
# === General Settings ===
[ general ]
2026-04-08 15:52:55 +03:00
use_middle_proxy = true
# Global ad_tag fallback when user has no per-user tag in [access.user_ad_tags]
2026-02-28 17:46:11 +03:00
# ad_tag = "00000000000000000000000000000000"
2026-04-08 15:52:55 +03:00
# Per-user ad_tag in [access.user_ad_tags] (32 hex from @MTProxybot)
# === Log Level ===
# Log level: debug | verbose | normal | silent
# Can be overridden with --silent or --log-level CLI flags
# RUST_LOG env var takes absolute priority over all of these
log_level = "normal"
2026-02-28 17:46:11 +03:00
[ general . modes ]
classic = false
secure = false
tls = true
2026-04-08 15:52:55 +03:00
[ general . links ]
show = "*"
# show = ["alice", "bob"] # Only show links for alice and bob
# show = "*" # Show links for all users
# public_host = "proxy.example.com" # Host (IP or domain) for tg:// links
# public_port = 443 # Port for tg:// links (default: server.port)
# === Server Binding ===
2026-03-16 13:40:50 +03:00
[ server ]
port = 443
2026-04-09 01:12:27 +03:00
# proxy_protocol = false # Enable if behind HAProxy/nginx with PROXY protocol
2026-04-08 15:52:55 +03:00
# metrics_port = 9090
2026-04-09 01:12:27 +03:00
# metrics_listen = "127.0.0.1:9090" # Listen address for metrics (overrides metrics_port)
# metrics_whitelist = ["127.0.0.1/32", "::1/128"]
2026-03-16 13:40:50 +03:00
2026-03-06 21:04:50 +03:00
[ server . api ]
enabled = true
2026-04-09 01:12:27 +03:00
listen = "127.0.0.1:9091"
whitelist = [ "127.0.0.1/32" , "::1/128" ]
2026-04-08 15:52:55 +03:00
minimal_runtime_enabled = false
minimal_runtime_cache_ttl_ms = 1000
# Listen on multiple interfaces/IPs - IPv4
[ [ server . listeners ] ]
ip = "0.0.0.0"
2026-03-06 21:04:50 +03:00
2026-02-28 17:46:11 +03:00
# === Anti-Censorship & Masking ===
[ censorship ]
2026-04-09 01:12:27 +03:00
tls_domain = "petrovich.ru" # Fake-TLS / SNI masking domain used in generated ee-links
2026-04-08 15:52:55 +03:00
mask = true
2026-04-09 01:12:27 +03:00
tls_emulation = true # Fetch real cert lengths and emulate TLS records
2026-04-08 15:52:55 +03:00
tls_front_dir = "tlsfront" # Cache directory for TLS emulation
2026-02-28 17:46:11 +03:00
[ access . users ]
# format: "username" = "32_hex_chars_secret"
hello = "00000000000000000000000000000000"
```
2026-03-06 21:04:50 +03:00
2026-03-01 15:05:39 +03:00
then Ctrl+S -> Ctrl+X to save
2026-02-28 17:46:11 +03:00
> [!WARNING]
2026-04-09 01:12:27 +03:00
> Replace the value of the `hello` parameter with the value you obtained in step 0.
> Additionally, change the value of the `tls_domain` parameter to a different website.
> Changing the `tls_domain` parameter will break all links that use the old domain!
2026-02-28 17:46:11 +03:00
---
2026-03-09 19:38:55 +03:00
**2. Create telemt user **
``` bash
useradd -d /opt/telemt -m -r -U telemt
chown -R telemt:telemt /etc/telemt
```
2026-03-25 17:40:45 +03:00
**3. Create service in /etc/systemd/system/telemt.service **
2026-02-28 17:46:11 +03:00
Open nano
``` bash
nano /etc/systemd/system/telemt.service
```
2026-03-25 17:40:45 +03:00
Insert this Systemd module:
2026-02-28 17:46:11 +03:00
``` bash
[ Unit]
Description = Telemt
2026-03-09 19:38:55 +03:00
After = network-online.target
Wants = network-online.target
2026-02-28 17:46:11 +03:00
[ Service]
Type = simple
2026-03-09 19:38:55 +03:00
User = telemt
Group = telemt
WorkingDirectory = /opt/telemt
ExecStart = /bin/telemt /etc/telemt/telemt.toml
2026-02-28 17:46:11 +03:00
Restart = on-failure
LimitNOFILE = 65536
2026-04-05 18:53:06 +03:00
AmbientCapabilities = CAP_NET_ADMIN CAP_NET_BIND_SERVICE
CapabilityBoundingSet = CAP_NET_ADMIN CAP_NET_BIND_SERVICE
2026-03-09 19:38:55 +03:00
NoNewPrivileges = true
2026-02-28 17:46:11 +03:00
[ Install]
WantedBy = multi-user.target
```
2026-03-01 15:05:39 +03:00
then Ctrl+S -> Ctrl+X to save
2026-02-28 17:46:11 +03:00
2026-03-09 19:38:55 +03:00
reload systemd units
``` bash
systemctl daemon-reload
```
2026-02-28 17:46:11 +03:00
2026-03-09 19:38:55 +03:00
**4. ** To start it, enter the command `systemctl start telemt`
2026-02-28 17:46:11 +03:00
2026-03-09 19:38:55 +03:00
**5. ** To get status information, enter `systemctl status telemt`
2026-02-28 17:46:11 +03:00
2026-03-09 19:38:55 +03:00
**6. ** For automatic startup at system boot, enter `systemctl enable telemt`
2026-02-28 17:46:11 +03:00
2026-03-25 17:40:45 +03:00
**7. ** To get the link(s), enter:
2026-03-06 21:04:50 +03:00
``` bash
2026-04-07 13:53:12 +03:00
curl -s http://127.0.0.1:9091/v1/users | jq -r '.data[] | "[\(.username)]", (.links.classic[]? | "classic: \(.)"), (.links.secure[]? | "secure: \(.)"), (.links.tls[]? | "tls: \(.)"), ""'
2026-03-06 21:04:50 +03:00
```
> Any number of people can use one link.
2026-02-28 17:46:11 +03:00
2026-03-25 17:40:45 +03:00
> [!WARNING]
> Only the command from step 7 can provide a working link. Do not try to create it yourself or copy it from anywhere if you are not sure what you are doing!
2026-02-28 17:46:11 +03:00
---
# Telemt via Docker Compose
**1. Edit `config.toml` in repo root (at least: port, users secrets, tls_domain) **
**2. Start container: **
``` bash
docker compose up -d --build
```
**3. Check logs: **
``` bash
docker compose logs -f telemt
```
**4. Stop: **
``` bash
docker compose down
```
> [!NOTE]
> - `docker-compose.yml` maps `./config.toml` to `/app/config.toml` (read-only)
> - By default it publishes `443:443` and runs with dropped capabilities (only `NET_BIND_SERVICE` is added)
> - If you really need host networking (usually only for some IPv6 setups) uncomment `network_mode: host`
2026-05-13 16:35:40 +05:00
> - If you enable mutating Control API endpoints, mount a writable config directory instead of a single `config.toml` file. Telemt persists config changes with atomic `tmp + rename` writes, and a single bind-mounted file can fail with `Device or resource busy`.
Example writable config mount for Control API mutations:
``` yaml
services :
telemt :
2026-05-13 16:42:01 +05:00
working_dir : /run/telemt
2026-05-13 16:35:40 +05:00
volumes :
2026-05-13 16:42:01 +05:00
- ./config:/etc/telemt:rw
tmpfs :
- /run/telemt:rw,mode=1777,size=4m
command : /usr/local/bin/telemt /etc/telemt/config.toml
2026-05-13 16:35:40 +05:00
```
2026-02-28 17:46:11 +03:00
**Run without Compose **
``` bash
docker build -t telemt:local .
docker run --name telemt --restart unless-stopped \
-p 443:443 \
2026-03-19 15:54:01 +03:00
-p 9090:9090 \
-p 9091:9091 \
2026-02-28 17:46:11 +03:00
-e RUST_LOG = info \
-v " $PWD /config.toml:/app/config.toml:ro " \
--read-only \
--cap-drop ALL --cap-add NET_BIND_SERVICE \
--ulimit nofile = 65536:65536 \
telemt:local
```