How to install Git on Ubuntu 24.04 step by step
If you install Git on Ubuntu 24.04, you can track changes to code, collaborate with other developers, and manage projects efficiently. Git is one of the most important tools for version control in software projects.
Step 1: Which server is right for your project?
Before you install Git, you should consider what type of server you want to use for your project. Git itself requires only a few resources, but it’s often used together with development environments, web projects, or automated deployments. In practice, two types of servers are usually suitable for this: a VPS (Virtual Private Server) or a Dedicated Server.
A VPS is essentially a type of virtual machine, running on a physical host system. Multiple virtual servers share the host system’s hardware, but each is allocated its own resources, such as RAM, CPU-shares, and storage. For smaller projects, personal development environments, or initial experiments with Git, a VPS is often sufficient. It is flexible in terms of scalability and typically more affordable than a physical server.
A dedicated server, in contrast, gives you exclusive access to all the hardware. You do not share resources with other users. This option is particularly suitable for larger development projects, teams with multiple developers, or complex applications with many repositories. A dedicated server also provides more performance reserves, making it ideal for running CI/CD pipelines or extensive build processes.
- 1 Gbit/s bandwidth & unlimited traffic
- Minimum 99.99% uptime & ISO-certified data centres
- 24/7 premium support with a personal consultant
Step 2: Update package lists
Before installing new software, you should first update your system’s package lists. Ubuntu manages software via the APT (Advanced Package Tool) package manager. It accesses central software sources and ensures that programs can be installed and updated securely. So start by updating the package information with the following command:
sudo apt update
sudo apt upgradebashThe command downloads the latest package lists from the Ubuntu repositories. This ensures that the system uses the most recent available versions of the software during installation. A prerequisite is that you have sudo privileges.
Step 3: Install Git
Once the package lists are updated, you can install Git directly through the package manager. Git is included in Ubuntu’s official package sources, so no extra repositories are required. To complete the installation, simply run the following command:
sudo apt install git -ybashThe -y parameter automatically confirms all installation prompts. During the installation, Ubuntu will download the necessary files and set up Git on your system. Depending on your internet connection, this process typically takes just a few seconds.
If you require graphical Git tools or integrations with other version control systems, you can install the git-all metapackage instead of git. This metapackage includes all available Git add-on packages.
Step 4: Verify the installation
After installation, it’s a good idea to verify that Git was installed correctly. You can do this by displaying the installed version. Run the following command:
git --versionbashAfter successfully installing Git on Ubuntu 24.04, the terminal will display the currently installed version number. This confirms that Git is properly installed and ready to use on your system.

Step 5: Configure Git
Before you start actively using Git, you should define some basic settings. These include, in particular, your name and email address. This information is stored with every Git commit so that changes can be clearly assigned to a specific person.
First, set your name using the following command:
git config --global user.name "your name"bashNext, add your email address:
git config --global user.email "your@email-address.com"bashThe --global option ensures that these settings apply system-wide for your user. You only need to configure them once.
To display all configured settings, you can use the following command:
git config --listbashThe terminal then displays an overview of all current Git settings.

Step 6: Create your first repository (optional)
After installation and configuration, you can follow a Git tutorial or, if you’re already familiar with Git, start using it immediately. For example, you can create a new repository. First, navigate to a directory of your choice:
cd project-folderbashNext, initialise a new Git repository:
git initbashGit will then create a hidden .git directory. This is where the system stores all version control information for your project. From this point on, you can track changes, create commits, and manage your project in an organised way.


