Building telegram-desktop from sources

I will try to fix this issue (ignore that the issue starts with a stellarium problem, at the end it is one with telegram-desktop, just scroll down) and compile Telegram from the sources…

The journey starts with cloning from git and install tools:

git clone
sudo apt install curl

get poetry:
curl -sSL | python3 -

cd tdesktop/Telegram/build/docker/centos_env
poetry install
poetry run gen_dockerfile | docker buildx build -t tdesktop:centos_env -
-bash: docker: command not found

I tried to install docker with sudo apt install docker, but this isn’t docker. It’s only this

dpkg -L docker

So, how can I get the docker software?

1 Like
$ apt show docker
Package: docker
Version: 1.5-2
Priority: optional
Section: x11
Maintainer: Paul Tagliamonte <>
Installed-Size: 9,216 B
Depends: wmdocker
Download-Size: 2,556 B
APT-Sources: byzantium/main arm64 Packages
Description: transitional package
 This is a transitional package for system tray docking application.
 It can safely be removed.

The package you’re after is called

1 Like

Thanks for the help. I installed it (and what was pulled in by it), but this docker tool does not fit the build instructions:

poetry run gen_dockerfile | docker buildx build -t tdesktop:centos_env -
unknown shorthand flag: 't' in -t
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND
Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/purism/guru/tdesktop/Telegram/build/docker/centos_env/", line 4, in <module>
    from jinja2 import Environment, FileSystemLoader
ModuleNotFoundError: No module named 'jinja2'

Seems to be a known issue, see:

@guru Why not using “Telegrand” a GTK client for Telegram instead for Telegram Desktop?

purism@pureos:~$ apt search “Telegrand”
Sorting... Done
Full Text Search... Done
1 Like

I could not get docker running correctly, filed an issue with telegram-desktop which was closed with the message:

“Install official Docker build from, distributives provide a shrinked version”

So, I give up building it on the L5 itself. I have an older amd64 laptop collecting dust, what would be the best (read closest to L5) to install, perhaps a Debian, but which version? Or PureOS itself?

I’d go for building on an up-to-date (and fast) desktop. On e.g. Debian you have phosh/phoc/squeekboard packages so you can run telegram-desktop nested on your desktop in a minimalistic phosh session which will make developing way simpler than directly on the device.