20

Is there a way to have two copies of telegram app in Ubuntu each with a different account?

It seems copying the app in another folder does not work.

11 Answers 11

12

What I do is run the Telegram binary as a different user

cd ~/Downloads/Telegram/
sudo -u otheruser ./Telegram
| improve this answer | |
  • This is the solution I use as I have yet to find a viable alternative to the telegram desktop app. most of the others are only wrappers for the web interface. – ridderhoff Feb 9 '17 at 4:10
  • 1
    For what its worth, you should run 'su otheruser' instead of 'sudo -u otheruser'. – crafter Nov 29 '17 at 12:14
31

With telegram desktop installed:

mkdir ~/.telegram2ndprofile 
telegram -many -workdir ~/.telegram2ndprofile 

Update

For macOS, use the official telegram for macOS: https://macos.telegram.org/ . It supports multiple accounts out of the box.

Source

| improve this answer | |
11

You can use Franz.

Franz allows you to add each service many times. This makes Franz the perfect tool to manage multiple business and private accounts at the same time. You could even use five different Facebook Messenger accounts at once, if some inexplicable reason urges you to do so.

| improve this answer | |
4

Three Ways:

  1. Install Chrome and there install Telegram from the Web Store.

  2. Install Wine and Telegram for Windows

  3. Enter in https://web.telegram.org/

| improve this answer | |
4

If you still want a tidier option using the abumalick's answer, you can add additional action(s) to the original launcher to add extra profile(s).

  1. cd ~/.local/share/ goes to the directory where Telegram Desktop data are stored under your home hierarchy;
  2. mkdir Telegram2 makes a new folder for the second Telegram profile;
  3. gedit applications/telegramdesktop.desktop opens Telegram Desktop launcher in text editor;
  4. Finally, add the following lines to the end:

(Address the Telegram executable file for Exec and also replace your username instead of $user)

Actions=SecondAccount;

[Desktop Action SecondAccount]
Name=Second Account
Exec=/home/$user/complete/address/to/the/Telegram -many -workdir /home/$user/.local/share/Telegram2

You may need a log out to see the changes take effect. Here’s how it looks on Ubuntu 20.04:

Telegram Desktop second instance

– tested on the latest Telegram v2.0

| improve this answer | |
3

For each instance you wish to open, create a fresh directory with Telegram and Updater files. Now create Telegram.desktop (or whatever name.desktop) file with this content:

[Desktop Entry]
Type=Application
Name=Telegram
Exec="$(dirname $(realpath %k))"/Telegram -workdir "$(dirname $(realpath %k))"
Categories=Internet;Messenger #Optional
Icon=Telegram #Optional
Terminal=false

Put this file inside your Telegram instance folder, make it executable, and run.
This will work even if you create a symlink of .desktop file and run it.

| improve this answer | |
3

You may try Cutegram. It supports multiple accounts (you can use them simultaneously).

Update: It seems development of Cutegram has ceased.

| improve this answer | |
2

You can use a multi-protocol, multi-account client like Pidgin (or anything based on libpurple):

  1. Add a package repository with Telegram support for libpurple:

    sudo add-apt-repository ppa:nilarimogard/webupd8
    sudo apt update
    
  2. Install Pidgin and the Telegram plug-in for it:

    sudo apt install pidgin telegram-purple
    
  3. Start Pidgin and set it up to use as many Telegram accounts as you like.

| improve this answer | |
1

You can use rambox, Franz or can login in the browser and use web.telegram.org

Att.

| improve this answer | |
1

Here's another method which applies to telegram-cli (available on Github, a working fork for Ubuntu 18.08 is here. Also available as a snap).

This is an improved version from this answer.

  1. Before the first run, edit 'config' file to create telegram profiles.

The config file is located under .telegram-cli directory. Depends on your installation method, you can find the file under $HOME/.telegram-cli/ (if built from source) or $HOME/snap/telegram-cli/25/.telegram-cli/ (if installed using snap).

Open the file and edit the following:

## This is an empty config file
## Feel free to put something here
profile1 = {
config_directory = "path/to/profile1";
msg_num = true;
};

profile2 = {
config_directory = "path/to/profile2";
msg_num = true;
};
  1. Once profiles are created, run the command like the following (on different terminals):

telegram-cli -p profile1 and telegram-cli -p profile2

You will be asked different phone numbers for each profiles that you have created. Also telegram-cli will create a different folder for each profiles.

TIPS: I find it very convenient using a telegram username in place of profile1 or profile2

| improve this answer | |
1

For Creating Multiple Desktop Shortcuts for different Telegram accounts, you need to create a bash-script file for running each telegram accounts and call it from inside the desktop shortcut scripts.

This is because, without the bash-script the script won't work directly in desktop shortcut file

Now if you don't know how to do the above yourself, just follow the below steps one by one:

  1. create two folders and call them 1stTelegram & 2ndTelegram.
  2. Inside each of the folders created above, create a folder call data.

The data folder holds each Telegram account data.

  1. First Telegram shortcut
#!/usr/bin/env xdg-open

[Desktop Entry]
Type=Application
Name=Telegram Science
Exec="/home/my_user/Programs/1stTelegram/runner.sh" 
Icon=/home/my_user/Programs/1stTelegram/icon.png
Name[en_US]=TelegramSicence
  1. Second Telegram shortcut
#!/usr/bin/env xdg-open

[Desktop Entry]
Type=Application
Name=Telegram
Exec="/home/my_user/Programs/2ndTelegram/runner.sh" 
Icon=/home/my_user/Programs/2ndTelegram/icon.png
Name[en_US]=Telegram
  1. create first runner.sh within /home/my_user/Programs/1stTelegram/ directory

  2. Edit the first runner.sh bash Script for the first instance of the telegram with associated data folder as follows

#!/bin/bash

/home/my-user/Programs/Telegram -many -workdir /home/my_user/Programs/1stTelegram/data
  1. Create second runner.sh within /home/my_user/Programs/2ndTelegram/ directory

  2. Edit the second runner.sh bash Script for running the second instance of telegram with associated data folder as follows

#!/bin/bash

/home/my_user/Programs/Telegram -many -workdir /home/my_user/Programs/2ndtTelegram/data

Take note that both instances use the same Telegram app to run

  1. Give both runner.sh enough permissions to run

chmod a+x runner.sh

  1. repeat the steps for adding additional accounts

Run the desktop shortcuts and enjoy!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.