How to Install and Configure AnyDesk on Ubuntu 22.04 via SSH
If you have only SSH access to your Ubuntu 22.04 server, you can still install and configure AnyDesk for remote desktop access. Below are step-by-step instructions to complete the setup.
Step 1: Update the System
First, update the package list to ensure all dependencies are up to date:
Step 2: Add AnyDesk Repository and GPG Key
Since AnyDesk is not included in the default Ubuntu repositories, we need to add its official repository.
1. Import the GPG Key
2. Add the AnyDesk Repository
3. Update Package Lists
Step 3: Install AnyDesk
Now, install AnyDesk using the following command:
Step 4: Start and Enable AnyDesk Service
Once installed, start the AnyDesk service:
Enable it to start automatically on system boot:
Check if the AnyDesk service is running:
You should see output similar to:
Step 5: Get AnyDesk Address
Since you are using SSH and don’t have a GUI, retrieve the AnyDesk ID manually by running:
This will return a 9-digit ID (e.g., 123 456 789
), which you will use to connect remotely.
If you need the current status of AnyDesk, run:
Step 6: Configure Unattended Access (Optional)
If you want to access the server without needing to accept the connection manually, set up a password:
- Create the security config file:
- Set proper permissions:
- Restart AnyDesk to apply changes:
Now you can connect to the Ubuntu server remotely using AnyDesk ID + password.
Step 7: Allow AnyDesk Through Firewall (If Enabled)
If UFW (Uncomplicated Firewall) is active, allow AnyDesk traffic:
Verify firewall rules:
Step 8: Connect to Your Ubuntu Server Remotely
From another device (Windows, Mac, Linux, or Android):
- Install AnyDesk from anydesk.com/download.
- Open AnyDesk and enter your Ubuntu AnyDesk ID (from Step 5).
- Click "Connect" and enter the password (if unattended access is enabled).
Remove AnyDesk (If Needed)
If you need to uninstall AnyDesk later: