1 ## Build instructions for Linux using Docker
5 Choose a folder for the future build, for example **/home/user/TBuild**. It will be named ***BuildPath*** in the rest of this document. All commands will be launched from Terminal.
7 ### Obtain your API credentials
9 You will require **api_id** and **api_hash** to access the Telegram API servers. To learn how to obtain them [click here][api_credentials].
11 ### Clone source code and prepare libraries
13 Install [poetry](https://python-poetry.org), go to ***BuildPath*** and run
15 git clone --recursive https://github.com/telegramdesktop/tdesktop.git
16 ./tdesktop/Telegram/build/prepare/linux.sh
18 ### Building the project
20 Go to ***BuildPath*/tdesktop** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
23 -v "$PWD:/usr/src/tdesktop" \
25 /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
26 -D TDESKTOP_API_ID=YOUR_API_ID \
27 -D TDESKTOP_API_HASH=YOUR_API_HASH
29 Or, to create a debug build, run (also using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
32 -v "$PWD:/usr/src/tdesktop" \
35 /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
36 -D TDESKTOP_API_ID=YOUR_API_ID \
37 -D TDESKTOP_API_HASH=YOUR_API_HASH
39 The built files will be in the `out` directory.
41 [api_credentials]: api_credentials.md