Setting Up Linux for Developers - Essential Tools

Setting Up Linux for Developers - Essential Tools

What This Guide Covers

  • The essential tools to install first on a fresh Linux machine
  • How to set up the package manager, editor, shell, Git, and SSH keys in the right order
  • How to make your environment reproducible so the next machine is painless

Quick Summary

  • Start with the package manager (it installs everything else)
  • Then add the four basics: editor, shell, Git, and SSH keys
  • Finally, script your steps / use dotfiles for reproducibility

Assumptions

  • Debian / Ubuntu family (apt) is used for examples
  • For other distros, see Package Managers Compared
  • You can use a terminal and sudo

What Tools Should You Install First?

Conclusion: Install five things first: a package manager, editor, shell, Git, and SSH keys.

In priority order, here is what to set up. Each item is covered in the sections below.

Order Tool Role
1 Package manager The base for installing everything
2 Editor Write and read code
3 Shell Interactive command environment
4 Git Version control and code sharing
5 SSH keys Secure auth to remotes / GitHub

Why Start With the Package Manager?

Conclusion: Starting from the OS package manager centralizes dependencies and updates.

Stitching together standalone installers makes updates and removals unmanageable. Update the package list first, then install the minimum base for development.

sudo apt update
sudo apt install -y build-essential git curl wget ca-certificates

build-essential is a meta-package that pulls in gcc, make, and other build tools. Many language runtimes and tools require these to compile.

Verify versions afterward so future issues are easier to diagnose.

gcc --version
git --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
git version 2.34.1

How Should You Pick an Editor and Shell?

Conclusion: Pick one editor you use daily and make bash or zsh your default shell.

Any editor is fine, but focusing on one at first speeds up learning. For terminal-only work, vim or nano are classics; for a GUI, VS Code is popular.

sudo apt install -y vim

The default shell on Debian / Ubuntu is bash. If you want stronger completion and history, zsh is an option. See bash vs zsh vs fish for how to choose.

When in doubt, stick with bash. Switch shells only after you are comfortable with the basics.

How Do You Set Up Git and SSH Keys?

Conclusion: Set your Git user and generate an SSH key first, and pushes will just work.

First, set your Git author info. Skipping this stops you at the first commit.

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Next, generate an SSH key. ed25519 is the current recommendation.

ssh-keygen -t ed25519 -C "you@example.com"

Display the public key and register it with a service such as GitHub (never share the private key).

cat ~/.ssh/id_ed25519.pub

After registering, a connection test returns a success message.

Hi your-name! You've successfully authenticated, but GitHub does not provide shell access.

Should Language Runtimes Be Installed Globally?

Conclusion: Avoid installing runtimes globally; use a version manager to switch per repo.

Installing language runtimes directly with apt traps you when projects need different versions. A version manager lets you switch per project.

Language Common version manager
Node.js nvm / fnm
Python pyenv
Ruby rbenv
Rust rustup

For example, Rust ships an official installer, rustup.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

For curl | sh installers, always confirm the URL is official before running. Never pipe an unknown script straight into your shell.

How Do You Make the Environment Reproducible?

Conclusion: Capture install steps in a script or dotfiles to reproduce the setup anywhere.

Doing every step by hand drifts between machines. Codifying the steps improves reproducibility.

The simplest approach is to put the install commands in a single shell script.

#!/usr/bin/env bash
set -euo pipefail

sudo apt update
sudo apt install -y build-essential git curl vim
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Config files (.bashrc, .gitconfig, .vimrc — your dotfiles) are usually kept in a Git repository and cloned on each new machine.

git clone git@github.com:your-name/dotfiles.git ~/dotfiles

You do not need perfection up front. Append as you go, and a personal setup script grows naturally.

Common Pitfalls and Fixes

Conclusion: Most snags come from permissions, PATH, or unregistered keys, not your tools.

  • Permission denied: Not enough write permission. Do not just add sudo; check ownership and permissions with ls -l first.
  • command not found: Installed but not on your PATH. Confirm the binary with which <command>.
  • Auth error on git push: Check that your SSH public key is registered with the service via ssh -T git@github.com.

What not to do

  • Re-running with sudo without reading the error
  • Running unknown scripts without checking them
  • Committing a private key to a repository

Next Reading