A fresh Linux workstation can have a working terminal and still fail the first repository task when compilers, Git identity, SSH access, editor defaults, or a project directory are missing. Bootstrapping those pieces before cloning or building code gives the local account a known starting point instead of discovering gaps during the first handoff.
The commands use APT on Ubuntu or Debian because package names and sudo behavior are predictable there. The same checklist can be adapted to other distributions by replacing the package installation step with the equivalent dnf, zypper, pacman, or vendor package workflow.
Run user-level Git and SSH commands as the account that will own the projects, not through sudo. Package installation needs administrative privileges, while identity, key, editor, and project-directory settings belong in the normal user's home directory.
Related: Install Git on Ubuntu
Related: Configure Git user name and email
Related: Create an SSH key pair
Steps to bootstrap a Linux development workstation:
- Open a terminal as the local account that will own the development projects.
Keep the same user account for the Git, SSH, and project-directory steps. Running those commands with sudo writes settings under root instead of the developer account.
- Refresh the APT package index.
$ sudo apt update
- Install the baseline development packages.
$ sudo apt install --assume-yes build-essential git curl ca-certificates openssh-client gnupg jq unzip zip python3 python3-venv python3-pip nano
build-essential installs the default compiler and make tools. python3-venv lets the account create isolated Python environments without modifying system packages.
- Confirm that APT installed the core package set.
$ dpkg-query -W build-essential git openssh-client python3-venv build-essential 12.12ubuntu2 git 1:2.53.0-1ubuntu1 openssh-client 1:10.2p1-2ubuntu3.2 python3-venv 3.14.3-0ubuntu2
Exact versions depend on the distribution release and enabled update repositories. The package names should appear instead of a no packages found message.
- Set the global Git author name for the current user.
$ git config set --global user.name "Example User"
- Set the global Git author email.
$ git config set --global user.email "user@example.net"
Use the email address that should appear in commits from this workstation.
Related: Configure Git user name and email - Set the default initial branch for new repositories.
$ git config set --global init.defaultBranch main
Replace main with the branch name used by your projects when a different default is required.
Related: Change the default branch for new Git repositories - Set nano as the default editor used by Git prompts.
$ git config set --global core.editor nano
Use a different installed editor when preferred. For editor settings used by non-Git tools, set $VISUAL and $EDITOR in the shell startup file.
Related: How to change the default editor in Linux - Review the saved global Git defaults.
$ git config list --global user.name=Example User user.email=user@example.net init.defaultbranch=main core.editor=nano
- Create an Ed25519 SSH key pair if this account does not already have one.
$ ssh-keygen -t ed25519 -C "user@workstation" Generating public/private ed25519 key pair. Enter file in which to save the key (/home/user/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_ed25519 Your public key has been saved in /home/user/.ssh/id_ed25519.pub The key fingerprint is: SHA256:tXtH/VwGC1b/CcB0r8WKV05KG2Lv9QPjjFZBJcE9xvY user@workstation ##### snipped #####
Do not overwrite an existing private key unless it is intentionally being replaced. Use a passphrase for an interactive user's private key, and copy only the .pub file to servers or Git hosting services.
Related: Create an SSH key pair - Print the public key fingerprint for access records.
$ ssh-keygen -lf ~/.ssh/id_ed25519.pub 256 SHA256:tXtH/VwGC1b/CcB0r8WKV05KG2Lv9QPjjFZBJcE9xvY user@workstation (ED25519)
- Display the public key line when a server or Git hosting account needs it.
$ cat ~/.ssh/id_ed25519.pub ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGU+H7TrzzwHtzv7fHyoptsyFjbULDrpf/DMMD7lyeSs user@workstation
Never paste the private key from ~/.ssh/id_ed25519 into a ticket, chat, browser form, or server authorized_keys file.
Related: Copy an SSH public key to a server - Create a parent directory for local source checkouts.
$ mkdir -p ~/src
- Create a disposable workstation check project.
$ mkdir -p ~/src/workstation-check
- Enter the disposable check project.
$ cd ~/src/workstation-check
- Initialize a local Git repository.
$ git init --initial-branch=main Initialized empty Git repository in /home/user/src/workstation-check/.git/
The explicit --initial-branch=main keeps this smoke test independent of any older default branch setting.
- Create a Python virtual environment in the check project.
$ python3 -m venv .venv
No output indicates the virtual environment was created. If this fails, confirm python3-venv is installed for the active distribution release.
- Create an empty verification commit.
$ git commit --allow-empty -m "Check workstation" [main (root-commit) eeb558d] Check workstation
This proves Git can write commits with the configured identity without adding sample project files.
- Verify that the disposable repository is on the expected branch.
$ git status --short --branch ## main
- Remove the disposable check project after the smoke test passes.
$ rm -rf ~/src/workstation-check
Run this command only for the temporary check directory created above. Keep real project directories under ~/src.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.