Ubuntu – How to run multiple instances of Telegram?

multiple instancestelegram

I am new to Linux and Ubuntu.

I need to run multiple instances of desktop Telegram. I saw the answers in How can I use multiple accounts with Telegram?

I do not understand how can I use the answer.

I extracted tsetup.1.1.23.tar.xz. and then opened the terminal and cd to that directory.

Also I created another administrator user named atk2 with no password.

I tried running telegram as another user like this:

sudo -u user2 ./Telegram

but it does not work. I get

No protocol specified
QXcbConnection: Could not connect to display :0

I also tried

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

but I get this error in using telegram command.

# telegram -many -workdir ~/.telegram2ndprofile
usage: telegram [-ynsr] user [ttyname] [message...]

What should I do to run multiple telegram instances?

Best Answer

  • Finally, I learned it. here is the detail of solution.

    1. download tsetup.1.1.23.tar.xz
    2. extract it.

      it is better to copy "Telegram" file from extracted folder to "/home/youruser/" . because you can simply open the Terminal by Ctrl+Alt+T.

    3. open a Terminal on that folder.

    4. create some folder for each Telegram account. for example:
    makedir ~/tel
    makedir ~/tel2
    1. run the Telegram as
    ./Telegram -many -workdir ~/tel
    1. for second user, open another Terminal and run Telegram as
    ./Telegram -many -workdir ~/tel2

    more option

    how can close the terminal without terminating the Telegram process?

    I found the solution from here. How to keep processes running after ending ssh session?

    install "screen" application

    sudo apt-get install screen

    Type screen in Terminal and Enter. screen Then start the Telegram.

    ./Telegram -many -workdir ~/tel  

    return back to the terminal and

    Press Ctrl-A then Ctrl-D.

    Thanks for your helps.