🕵️‍♂️ Engage in discussions ANONYMOUSLY. NO REGISTRATION is required. 💬

✅ Registered accounts earn up to $25 per thread via PayPal and BTC. 🤑 Read more in News and Announcments! Unlock the ability to chat, share, send private messages and earn money per post in our community. Just register an account. It's Free!

SignUp Now!
  • 🕵️‍♂️ Engage in discussions ANONYMOUSLY. NO REGISTRATION is required. 💬 ✅ Registered accounts earn up to $25 per thread via PayPal and BTC. 🤑 Read more... Unlock the ability to chat, share, send private messages and earn money per post in our community. Just register an account. It's Free!

Question Running Multiple Instances of Telegram Desktop on Linux

Choose this one if you want to ask a question
New member
Joined
Aug 20, 2023
Messages
4
Credits
57
I'm migrating to Linux and trying to figure out how to run multiple instances of Telegram Desktop in 2023. I've been searching online but I only find old solutions to this problem and nothing current. Currently, I have one instance of Telegram Desktop running on my Telegram Desktop, but I have another number that I want to use for a separate instance

Things I've tried unsucssesfully:

1. Downloading two instances of Telegram - one from the official ppa, and the second from the website as portable
> In this case when I scan the QR code with my phone on the first instance, the second one shuts right away and logs me out​
2. Using different directories and using the -workdir switch to get dual instances of Telegram Desktop, but that approach just brings the first Telegram Desktop into focus.

Does anyone have any suggestions or solutions for running multiple instances of Telegram Desktop on Linux? Any help would be greatly appreciated! 😊
 
Solution
I also sugget a similar approach but in my opinion way easier:

1. Create a directory for your second Telegram instance

Code:
sudo mkdir -p ~/.TelegramVS

2. Then right click on your Desktop -> Create New -> Link to Application:

Owner, Group, Others -> Can View & Modify​
check on "is executable"​

1695553122320.png

3. Inside the Application Tab:
> Give the Application a name in my case "VS Telegram"​
> Command​
Bash:
/usr/local/Telegram/Telegram -many -workdir ~/.YOURAPPLICATIONNAME
1695553478709.png
Moderator
Joined
Sep 22, 2023
Messages
114
Credits
11
You must have 10 posts to see the links. Currently you had 0 posts.
pretty much says it all. Follow these steps:

Remove every different instance of Telegram you may have installed. (Especially if they are installed with flatpack or snap):

Bash:
sudo apt update
sudo apt remove telegram[/ICODE]

1. Open a terminal window and enter the following command to add the official Telegram PPA to your system:

[CODE=bash]sudo add-apt-repository ppa:atareao/telegram

2. Update your package list by entering:

Bash:
sudo apt update
Install Telegram Desktop by entering the following command:
sudo apt install telegram-desktop

3. Once you have installed Telegram Desktop, create a new directory for the second instance of the app:

Code:
mkdir telegram-desktop2

4. Copy the Telegram Desktop executable to the new directory:

Code:
cp /usr/bin/telegram-desktop telegram-desktop2/

5. Rename the copied executable file to something like "telegram-desktop2":

Code:
mv telegram-desktop telegram-desktop2/telegram-desktop2

6. Create a new shortcut or launcher for the second instance:

Code:
nano ~/.local/share/applications/telegram-desktop2.desktop

7. Add the these lines to the new desktop file:

[Desktop Entry]
Code:
Name=Telegram Desktop 2
Exec=/home/username/telegram-desktop2/telegram-desktop2
Icon=/usr/share/icons/hicolor/scalable/apps/telegram.svg
Type=Application
Categories=Network;InstantMessaging;

Replace "username" with your actual username. Save and close the desktop file. Finally, launch the second instance of Telegram Desktop using the new shortcut or launcher.
 
New member
Joined
Aug 20, 2023
Messages
4
Credits
57
Thank you so much for the input! I wanted to accept both answers but actually I tried this in the guide and failed miserably. the other one of @bjordanov worked better for me. It was easier and I did it without an effort .
 
Moderator
Joined
Aug 18, 2023
Messages
19
Credits
216
I also sugget a similar approach but in my opinion way easier:

1. Create a directory for your second Telegram instance

Code:
sudo mkdir -p ~/.TelegramVS

2. Then right click on your Desktop -> Create New -> Link to Application:

Owner, Group, Others -> Can View & Modify​
check on "is executable"​

1695553122320.png

3. Inside the Application Tab:
> Give the Application a name in my case "VS Telegram"​
> Command​
Bash:
/usr/local/Telegram/Telegram -many -workdir ~/.YOURAPPLICATIONNAME
1695553478709.png
 
New member
Joined
Aug 20, 2023
Messages
4
Credits
57
I appreciate the answer and the screenshots! This worked for me out of the box. Was super easy. Thank you so much!
 
Solution
Moderator
Joined
Aug 18, 2023
Messages
19
Credits
216
Here is an additional method I use to change the ICON of the instance permanently to an icon of my choice. This way I can differentiate between both instances.

1. Create a desktop entry using your editor of choice:​

THERE ARE VALUES IN BOLD YOU MUST CHANGE YOURSELF!
nano /home/YOURUSERNAME/.local/share/applications/telegram-2.desktop

Bash:
[Desktop Entry]
Name=Telegram Desktop VS Launcher
Comment=Launch Telegram with custom icon
Exec=/home/[B]YOURUSERNAME[/B]/scripts/desktop_gui/[B]telegram-vs-icon-change.sh[/B]
Icon=internet-chat
Terminal=false
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;

chmod +x /home/YOURUSERNAME/.local/share/applications/telegram-2.desktop

2. Look at the .desktop FILE NAME that Telegram generates on launch:​

Every time you launch telegram it will generate .desktop entry inside /home/YOURUSERNAME/.local/share/applications/

The file name looks something like this: org.telegram.desktop._3620ae571027ba30f986dd171a0ebdd7.desktop

Test to open the instance of Telegram using that .desktop file to see which instance it opens

Get this name and override it inside the script below

3. Create a script that overrides the Telegram icon on launch:​

THERE ARE VALUES IN BOLD YOU MUST CHANGE YOURSELF!

nano ~/scripts/desktop_gui/telegram-vs-icon-change.sh

Bash:
#!/bin/bash
# Change the icon in the specified desktop file
sed -i 's/Icon=.*/Icon=[B]internet-chat[/B]/' /home/[B]YOURUSERNAME[/B]/.local/share/applications/[B]org.telegram.desktop._3620ae571027ba30f986dd171a0ebdd7.desktop[/B]

# Wait for 2 seconds
#sleep 2

# Launch Telegram
/home/[B]YOURUSERNAME[/B]/.TelegramVS/Telegram -many -workdir /home/[B]YOURUSERNAME[/B]/.TelegramVS/ -- %u &

# Wait for 5 seconds
sleep 5

# Change the icon in the specified desktop file
sed -i 's/Icon=.*/Icon=internet-chat/' /home/[B]YOURUSERNAME[/B]/.local/share/applications/[B]org.telegram.desktop._3620ae571027ba30f986dd171a0ebdd7.desktop[/B]

You are supposed to change:

  • internet-chat > with the path of your icon or icon name
  • org.telegram.desktop._3620ae571027ba30f986dd171a0ebdd7.desktop > with your generated .desktop file
  • YOURUSERNAME > with your own username

What this does is basically:
1. Creating a .sh script that will override the Telegram icon in the second instance with a custom icon of our choice
2. Creating a desktop entry that launches that script
3. Making both executable
 
  • Great post
Reactions: w_G
Top