Install AnyDesk on Ubuntu 24

Linux September 18, 2026 27 Views 3 min read
Install AnyDesk on Ubuntu 24

Install AnyDesk on Ubuntu 24.04

This tutorial shows how to install AnyDesk on an Ubuntu 24 system using a Bash script. The script adds the AnyDesk repository, installs the package, updates the GDM configuration, and then asks you to reboot the system.

Important: This script changes the GDM login configuration and enables automatic login. Review the settings for your environment before running it.

What the Script Does

  1. Adds the AnyDesk GPG key.
  2. Adds the AnyDesk APT repository.
  3. Updates the Ubuntu package list.
  4. Installs AnyDesk.
  5. Backs up the existing GDM configuration.
  6. Writes the new GDM configuration.
  7. Asks you to reboot the system.

1. Save the Script

Save the following file as install-anydesk.sh:

#!/bin/bash
set -e

echo ">>> Adding AnyDesk GPG key..."
wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/anydesk.gpg

echo ">>> Adding AnyDesk repository..."
echo "deb [signed-by=/usr/share/keyrings/anydesk.gpg] http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk.list

echo ">>> Updating package list..."
sudo apt update

echo ">>> Installing AnyDesk..."
sudo apt install -y anydesk

echo ">>> Backing up and replacing GDM config..."
sudo mv /etc/gdm3/custom.conf /etc/gdm3/custom.conf-bkp

echo ">>> Writing new GDM config..."
sudo bash -c "cat > /etc/gdm3/custom.conf << 'EOF'
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = \$USERNAME

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
EOF"

echo "✅ Done. Reboot your system to apply GDM and AnyDesk changes."

2. Make the Script Executable

chmod +x install-anydesk.sh

3. Run the Script

sudo ./install-anydesk.sh

4. What Each Part Does

Add the AnyDesk GPG Key

wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/anydesk.gpg

Downloads the repository signing key and stores it in the system keyring.

Add the AnyDesk Repository

echo "deb [signed-by=/usr/share/keyrings/anydesk.gpg] http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk.list

Adds the AnyDesk package repository to the Ubuntu system.

Install AnyDesk

sudo apt update
sudo apt install -y anydesk

Refreshes the package list and installs AnyDesk.

Back Up the GDM Configuration

sudo mv /etc/gdm3/custom.conf /etc/gdm3/custom.conf-bkp

Moves the existing GDM configuration to a backup file before the new configuration is written.

Update GDM

The script creates a new /etc/gdm3/custom.conf file containing the GDM settings used by the script.

5. Reboot the System

sudo reboot

The script itself only displays the message asking you to reboot. Run the command above after reviewing the changes.

Quick Reference

chmod +x install-anydesk.sh
sudo ./install-anydesk.sh
sudo reboot

Important Note

The script provided in this tutorial is reproduced from the supplied setup script. Test it on a non-production system first and review the GDM automatic login settings before applying it to a production or shared machine.

Conclusion

This Bash script provides a quick way to install AnyDesk on Ubuntu 24 and apply the supplied GDM configuration changes in one step.

Discussion (0)