Setting up Signal Desktop without a mobile device
2022 February 21
I mentioned using signal-cli recently, but I didn't actually explain how, just linked to a guide.
Here's my own guide.
Requirements
- a phone number
- a desktop computer
- a username
The phone number just needs to be able to receive an SMS message or a phone call. I did not have luck using those public "receive an SMS" phone numbers (e.g., these services), though. I was able to register with my JMP.chat number, but that's a personal number I am paying for.
If it's not an amd64 CPU, this may not work. If it does work, it will almost certainly require additional steps. I'll assume you're running Linux, but the steps probably aren't too different for other operating systems.
You'll need to associate your number with a username to make some features like groups work properly.
Download signal-cli
- Install Java 17+
cd
into /opt- Download signal-cli from GitHub
- Verify the download
- Extract the archive
- Symlink to the executable
Depending on your distro, this might be something like openjdk-17-jre
(Debian) or java-17-openjdk
(Fedora) or jre-openjdk
(Arch).
You may need to become root first (e.g., sudo su
).
cd /opt
We'll dump signal-cli here for convenience.
On Linux, for instance,
export VERSION=0.11.6
Replace 0.11.6 with the current version.
curl -LO https://github.com/AsamK/signal-cli/releases/download/v${VERSION}/signal-cli-${VERSION}-Linux.tar.gz
Linux releases are signed with a key with fingerprint FA10826A74907F9EC6BBB7FC2BA2CD21B5B09570. To verify the download, first fetch this key:
gpg --recv-keys FA10826A74907F9EC6BBB7FC2BA2CD21B5B09570
gpg: key 2BA2CD21B5B09570: public key "AsamK <asamk@gmx.de>" imported gpg: Total number processed: 1 gpg: imported: 1
Download the signature:
curl -LO https://github.com/AsamK/signal-cli/releases/download/v${VERSION}/signal-cli-${VERSION}-Linux.tar.gz.asc
Verify the signature:
gpg --verify-files signal-cli-${VERSION}-Linux.tar.gz.asc
gpg: assuming signed data in 'signal-cli-0.11.6-Linux.tar.gz' gpg: Signature made Sun Dec 18 14:24:42 2022 EST gpg: using RSA key FA10826A74907F9EC6BBB7FC2BA2CD21B5B09570 gpg: Good signature from "AsamK <asamk@gmx.de>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: FA10 826A 7490 7F9E C6BB B7FC 2BA2 CD21 B5B0 9570
(The important part is the "Good signature from [ID]" bit. It is normal that it says the key is not certified with a trusted signature. This is because we haven't verified the key and manually set it to trusted. It does not mean that the key is invalid.)
tar xzf signal-cli-${VERSION}-Linux.tar.gz
sudo ln -s /opt/signal-cli-${VERSION}/bin/signal-cli /usr/local/bin/signal-cli
Set up signal-cli
Here, signal-cli will act as your primary (mobile) device. In a later step, we will link with Signal Desktop.
- Become a regular user again
- Register your phone number
- If this works, you should receive a 6-digit verification code via SMS. Use this to verify your account
- Set a username
- (Optional) Run signal-cli as a systemd service
signal-cli -u +12345556789 register
Replace +12345556789 with your own phone number, formatted like that. Include the +<country code> and do not use spaces or hyphens.
Most likely, you will need to fill out a CAPTCHA. In this case, complete one from https://signalcaptchas.org/registration/generate.html. You should be redirected to a page with an "Open Signal" link. Copy that link URL. The part of the URL you will need is everything after signalcaptcha://
. Try to register again, using this long response:
signal-cli -u +12345556789 register --captcha 'signal-recaptcha-v2.6<several lines of random-looking stuff>'
signal-cli -u +12345556789 verify 123456
signal-cli -u +12345556789 updateProfile --name MyUsername
This is necessary for some things like v2 groups.
You can run signal-cli as a daemon with signal-cli -u +12345556789 daemon
. You may want to do this with systemd. I have a systemd service at ~/.config/systemd/user/signal-cli@.service that looks like this:
[Unit] Description=Signal cli for %I Requires=dbus.socket After=dbus.socket Wants=network-online.target After=network-online.target [Service] Type=dbus Environment="SIGNAL_CLI_OPTS=-Xms2m" ExecStart=/usr/local/bin/signal-cli -u +%I daemon --ignore-attachments BusName=org.asamk.Signal [Install] WantedBy=default.target
This lets me control the signal-cli@12345556789.service
systemd service, e.g.:
systemctl --user start signal-cli@12345556789
Note: This setup runs this as a user service. You may need to install libunixsocket-java and dbus-user-session. See this issue.
You may wish to take additional steps, such as adding a registration PIN with setPin
.
Link Signal Desktop
I'll assume you already have Signal Desktop installed.
- Open Signal Desktop
- Take a screenshot of the QR code
- Decode the QR code with
zbarimg
- Add the new device
On first launch, Signal Desktop should display a QR code to be scanned from the primary ("phone") device.
zbarimg my_qr_code.png
This should output something like this:
QR-Code:sgnl://linkdevice?uuid=<a UUID>&pub_key=<a public key>
Copy the link starting with "sgnl://".
Using the link from the previous step, run this command:
signal-cli -u 12345556789 addDevice --uri 'tsdevice:/<link from above>'
Signal Desktop should now sync with your signal-cli account. From here on, you should be able to do most things from Signal Desktop and not have to deal with signal-cli (though you should still run signal-cli to keep it synced).
Updating signal-cli
When you need to update signal-cli, just download the new version:
- Remove the existing symlink
- Follow the steps from above to download the new version of signal-cli and create a new symlink
sudo rm /usr/local/bin/signal-cli