How to Install GitHub Desktop on Ubuntu 24.04, 22.04 or 20.04

This guide will demonstrate how to install GitHub Desktop on Ubuntu 24.04, 22.04 or 20.04 LTS Linux releases utilizing the command-line terminal and various methods such as .deb file installation, APT PPA, or Flatpak with Flathub.

GitHub Desktop stands as a beacon for developers looking to streamline their version control workflows. At its core, GitHub Desktop is designed to simplify how developers collaborate on projects, offering a graphical interface that complements the traditional command-line operations. It brings together a host of features aimed at enhancing productivity and making version control more accessible to both novice and experienced users alike.

  • Intuitive Interface: Simplifies the Git and GitHub workflow for scanning history, branching, and committing changes.
  • Repository Management: Easily clone, add, or publish repositories right from the desktop application.
  • Branches and Merges: Visualize your work and push changes without touching the command line.
  • Commit History: Browse your repository’s history to understand changes and revert them if necessary.
  • Pull Requests: Create, review, and merge pull requests directly from the desktop application, fostering collaboration.
  • Issue Tracking: Keep track of issues with a seamless integration that links code and issues.
  • Unified Experience: Synchronize your work across devices, ensuring continuity in your projects.
  • Extensibility: Integrates with a multitude of third-party services and tools, enhancing its utility.

As we pivot to the technical how-to, remember that GitHub Desktop is more than just a tool; it’s a partner in your development journey, designed to make version control intuitive and efficient. Now, let’s dive into the installation process.

Update Ubuntu Before GitHub Desktop Installation

Before starting the installation process, it’s essential to ensure your system is up-to-date to prevent conflicts. You can do this by using the following command in the terminal:

sudo apt update && sudo apt upgrade

This command updates your system’s package lists and installs any available updates, ensuring you have the latest software installed.

Install GitHub Desktop on Ubuntu

Option 1: Install GitHub Desktop on Ubuntu via .deb package

GitHub supports only Windows and macOS by default. However, Linux users can access GitHub through the “shiftkey/desktop” project. This fork provides downloadable packages for various Linux distributions.

Navigate to the releases page and download the latest release. Although the guide suggests installing the “.deb” package, you may opt for the appimage if you prefer it and know how to use it.

Use the following command in your terminal to download the latest release:

wget https://github.com/shiftkey/desktop/releases/download/release-3.1.7-linux1/GitHubDesktop-linux-3.1.7-linux1.deb

Note: Remember to get the latest link. The above command is just an example using the wget command.

This command downloads and installs version 3.1.7 RC1 as an example. Replace <filename> in the command below with the name of the “.deb” file you’ve downloaded:

sudo dpkg -i <filename>.deb

Example with 3.1.7 RC1:

sudo dpkg -i GitHubDesktop-linux-3.1.7-linux1.deb

Ubuntu users unfamiliar with dpkg should note that it is a package manager for installing, removing, and managing Debian packages. This low-level tool installs .deb packages on your Ubuntu system. The “-i” flag instructs dpkg to install the specified package; when using it, provide the package filename you wish to install as an argument.

Option 2: Install GitHub Desktop on Ubuntu via APT PPA

The second GitHub Desktop installation option mirrors the first. Two APT third-party repositories in the United States mirror the shiftkey/desktop GitHub project. The project’s page lists and recommends these repositories. This method simplifies updating your GitHub Desktop application and other packages. However, some global users might experience connection issues to a US mirror, which won’t impact most users.

Note: Only import one mirror; you can safely import the other if it does not work.

Import Shiftkey GitHub Desktop Mirror

The first one is recommended, but you can use the second one if you encounter any issues.

Import GPG key and repository for @shiftkey:

GPG Key:

wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null

Repository:

sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages.list'

Import Mwt GitHub Desktop Mirror

Alternative mirror by @mwt:

GPG Key:

wget -qO - https://mirror.mwt.me/shiftkey-desktop/gpgkey | gpg --dearmor | sudo tee /etc/apt/keyrings/mwt-desktop.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mwt-desktop.gpg] https://mirror.mwt.me/shiftkey-desktop/deb/ any main" > /etc/apt/sources.list.d/mwt-desktop.list'

After importing a mirror, run a quick APT update to reflect the newly added lists.

sudo apt update

To install GitHub Desktop, use the following command:

sudo apt install github-desktop

Option 3: Install GitHub Desktop on Ubuntu via Flatpak and Flathub

The third method to install GitHub Desktop on Ubuntu involves using Flatpak, a powerful utility that simplifies installing and managing Linux applications.

Flatpak provides a secure and isolated environment in which applications can run on your system, offering a range of benefits such as better stability, improved security, and easier management of dependencies.

Note: If you’re not familiar with installing Flatpak, we recommend following our step-by-step guide for Ubuntu. This guide uses the official LaunchPAD PPA provided by the Flatpak team to help you through the process.

Enable Flathub Repository on Ubuntu for GitHub Desktop

To use Flatpak, you must enable it on your Ubuntu system by executing a command in your terminal. The command you need to run is as follows:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install GitHub Desktop on Ubuntu via Flatpak Command

Now install Github using the following flatpak command:

flatpak install -y flathub io.github.shiftey.Desktop

This command downloads and installs the GitHub Desktop application, including all necessary dependencies, onto your Ubuntu system.

Launch GitHub Desktop on Ubuntu via CLI Commands or GUI Path

Now that you’ve successfully installed GitHub Desktop on your Ubuntu system, you can launch it differently depending on how you installed it.

CLI Commands to Launch GitHub Desktop UI

First, if you have your terminal open, you can launch the GitHub desktop client using the following command:

github-desktop

Flatpak users, you can use the following command to launch immediately:

flatpak run io.github.shiftey.Desktop

GUI Path to Launch GitHub Desktop UI

Alternatively, you can find GitHub Desktop on your desktop by clicking “Activities” and selecting “Show Applications.” This lists all installed applications on your system, including GitHub Desktop. You can click on the application to launch it and start using it for your projects.

Launching GitHub Desktop from the application menu in Ubuntu 24.04, 22.04, or 20.04.
How to open GitHub Desktop from the Ubuntu application menu.

First-Time Tips with GitHub Desktop on Ubuntu

Now that you have successfully installed GitHub Desktop on Ubuntu, here are some first-time tips on getting started with the software:

General Tips for GitHub Desktop on Ubuntu

  • Verify Installation: Ensure that GitHub Desktop is properly installed by running github-desktop from your terminal. This step confirms that the application can be launched successfully in your Linux environment.
  • Configure Git: Before diving into projects, configure your Git settings. Use the commands git config --global user.name "Your Name" and git config --global user.email "youremail@example.com" to set up your identity. This is crucial for commit messages.
  • SSH Keys: Generate and add SSH keys to your GitHub account for secure connections. Use ssh-keygen to create a new SSH key and add it to your GitHub account under Settings > SSH and GPG keys.
  • GitHub CLI: Consider installing the GitHub CLI (gh) for Ubuntu. This tool enhances your GitHub experience by allowing you to interact with GitHub directly from your terminal.

Customizations for a Better GitHub Desktop Experience

  • Theme Customization: Personalize your GitHub Desktop by adjusting the theme. Although GitHub Desktop’s customization options might be limited compared to the web version, you can explore third-party themes or tools that modify your desktop environment to match your GitHub theme.
  • Aliases in Git: Save time with aliases for commonly used Git commands. For example, set an alias like git config --global alias.co checkout to shorten the checkout command to git co.
  • Git Ignore Files: Set up a global .gitignore file for files and directories you never want to commit, like system files or IDE settings. Use git config --global core.excludesFile '~/.gitignore_global' to define it globally.
  • Integrate with Your IDE: Most Integrated Development Environments (IDEs) have GitHub integration. Ensure that your IDE is set up to connect with GitHub, streamlining your development workflow.

Productivity Boosters for GitHub Desktop

  • Use Markdown: GitHub supports Markdown for issue tracking, comments, and documentation. Utilize Markdown to format your text efficiently, create lists, or add links and images to make your documentation clearer.
  • Explore GitHub Actions: Automate your workflow with GitHub Actions. This can range from automated testing to deploying your code. GitHub Actions can significantly enhance your productivity and ensure consistent code quality.
  • Project Boards: Take advantage of GitHub’s project boards to organize and prioritize your work. Use them to track progress on features, bugs, or general tasks in a Kanban-style layout.
  • Leverage GitHub Gist: Use Gist for sharing snippets of code or text. Gists can be version-controlled and forked, making them perfect for collaboration or noting down quick ideas.

GitHub Desktop Keyboard Shortcuts

Utilizing keyboard shortcuts can significantly speed up your workflow. Here are some essentials:

  • General Shortcuts:
    • Ctrl + Shift + K to delete a line.
    • Ctrl + Enter to commit the changes you’ve staged.
    • Ctrl + Shift + A to add all changes to staging.
  • Navigation Shortcuts:
    • Ctrl + 1 to switch to the Changes tab.
    • Ctrl + 2 to switch to the History tab.
    • Ctrl + T to open a new tab with the repository you specify.
  • Repository Management:
    • Ctrl + N to create a new repository.
    • Ctrl + O to open a repository.
    • Ctrl + F to find a file in your current repository.

Remember, these tips are just the beginning of optimizing your GitHub workflow on Ubuntu. As you become more familiar with GitHub Desktop and its command-line counterparts, you’ll find even more ways to enhance your productivity and make the most out of your development projects.

GitHub Desktop ready for use on Ubuntu 24.04, 22.04, or 20.04 after successful installation.
GitHub Desktop installed and operational on Ubuntu Linux.

Additional GitHub Desktop Commands on Ubuntu

Update GitHub Desktop

To update your GitHub Desktop installation on Ubuntu, the process differs slightly depending on whether you installed it via Flatpak, .deb package, or APT.

For Flatpak installations, you can run the following command in the terminal to check for updates:

flatpak update

If you installed GitHub Desktop using the APT mirror, you could run the standard APT update and upgrade commands:

sudo apt update && sudo apt upgrade

However, if you installed GitHub Desktop using the .deb package, you must update it manually. To do this, you can visit the official GitHub Desktop releases page, download the latest .deb package, and install it using the dpkg command.

Remove GitHub Desktop

To remove GitHub Desktop from your Ubuntu system, if it no longer interests you, use a simple terminal command that matches the package manager from which you originally installed the software.

APT GitHub Desktop Remove Method

If you installed GitHub Desktop using the APT package manager, you could use the following command to remove the desktop client:

sudo apt remove github-desktop

Remove the APT repository if you don’t plan to reinstall GitHub using this method. Execute the appropriate command corresponding to the imported repository.

sudo rm /etc/apt/sources.list.d/shiftkey-packages.list
sudo rm /etc/apt/sources.list.d/mwt-desktop.list

Flatpak GitHub Desktop Remove Method

For installations using Flatpak, you can use the following command to remove GitHub Desktop, including all its data:

flatpak remove  -y --delete-data io.github.shiftey.Desktop

This command deletes all associated data and configuration files from your system, frees up space, and ensures a clean uninstallation.

.deb GitHub Desktop Remove Method on Ubuntu

However, if you installed GitHub Desktop using the .deb package, you’ll need to use the dpkg command to remove it manually. You can use the following command to remove the package:

sudo dpkg -r github-desktop

or

sudo apt remove github-desktop

This command removes the package from your system but doesn’t delete any associated data or configuration files. If you want to remove these, use the –purge option.

Conclusion and Wrap-up

Throughout this guide, we walked through the steps to install GitHub Desktop on Ubuntu, covering versions 24.04, 22.04, and 20.04 LTS. We’ve equipped you with essential tips for first-time users, from general advice to productivity boosters and even keyboard shortcuts to enhance your GitHub experience on Linux. As you dive into your projects, remember the importance of setting up your Git configurations correctly and exploring the full potential of GitHub’s features. Whether you’re collaborating on open-source projects or managing your own, GitHub Desktop on Ubuntu is a powerful ally. Keep experimenting, stay curious, and happy coding!

Leave a Comment


Your Mastodon Instance
Share to...