_This guide has been tested with Tails OS versions **5.9**, **5.10** and **5.11**_
## Persistent Storage
If you want to keep Telegram Desktop persistent, we need to set up the Persisent storage accordingly: (if you want to use Telegram Desktop only once and lose everything after shutdown/reboot skip to section [Install](#Install))
0. Make sure you are using an up to date Tails OS, check out https://tails.boum.org/doc/upgrade/.
1. Create persistent storage, follow the steps on https://tails.boum.org/doc/persistent_storage/create/, skip to step 2 if you already have a persistent storage
2. Configure persistent storage with _[Additonal software](https://tails.boum.org/doc/persistent_storage/configure/#index12h2)_ enabled and features according to your other needs (mail, pgp, additional software) follow the steps on https://tails.boum.org/doc/persistent_storage/configure/, skip to step 3 if you already have configured your persistent storage with _additional software_ enabled.
3. (Re)start your Tails and setup an administration password, follow section _Set up an administration password_ at https://tails.boum.org/doc/first_steps/welcome_screen/administration_password/.
4. Choose Applications ▸ System Tools ▸ Terminal
5. Get root privileges with executing `sudo -i` use the password set in step 3.
6. In order to create persistent storage for [Flatpak](https://flatpak.org), a package manager we're going to use for installing Signal Desktop and keeping the software, settings, keys, messages etc. persistent, execute
~~~
sed -i '$ a /home/amnesia/.local/share/flatpak source=flatpak\ /live/persistence/TailsData_unlocked/persistence.conf\n/home/amnesia/.var/app source=var_app'
~~~
7. Shutdown Tails.
## Install
### Flatpak
0. If you already have Flatpak installed with Flathub repo configured, skip to [Telegram Desktop](#telegram-desktop)
1. Start your Tails with persistent storage unlocked and setup an administration password, follow section _Set up an administration password_ at https://tails.boum.org/doc/first_steps/welcome_screen/administration_password/.
2. Choose Applications ▸ System Tools ▸ Terminal
3. Install the package manager Flatpak with executing
4. Make the installation persistent (_Install every time_) following step 3. at https://tails.boum.org/doc/persistent_storage/additional_software/#index4h2
5. No we add the Flathub repository to Flatpak, executing
Ignore _WARNING torsocks[33952]: [syscall] Unsupported syscall number 315._
### Telegram-Desktop
1. Using the Terminal install telegram-desktop, executing `torify flatpak install flathub org.telegram.desktop` and confirm with `Y`.
2. For running telegram-desktop its convenient using an executable shell script, create it executing
~~~
echo -e '#!/bin/sh\nflatpak run org.telegram.desktop' | tee -a /home/amnesia/Persistent/telegram-desktop.sh && chmod +x /home/amnesia/Persistent/telegram-desktop.sh
~~~
### Start
1. Start Tails with persistent storage unlocked.
2. Choose Applications ▸ System Tools ▸ Terminal
3. Execute `Persistent/telegram-desktop.sh`
#### First time start
4. Outside the unsafe browser, Tails is configured to limit network use to the Tor network only. Therefore we need to tell telegram-desktop to use [Tor's SOCKS proxy](https://tails.boum.org/contribute/design/stream_isolation/#Implementation). Click the protective shield icon on the left or Settings▸Advanced Options▸Proxy Settings.
5. Click the _Connection Type_ button and choose the _Custom Proxy/Add Proxy_ option.
6. Select _SOCKS5_
7. Fill in Hostname `127.0.0.1` and port `9050`.
8. Select newly created proxy and save the settings.