Setting Up a Dev Environment on Linux

Linux is the developer's natural habitat. Here's how to set up everything you need to start coding.

Why Developers Love Linux

If you're getting into software development, Linux is arguably the best place to be. Here's why:

Code Editors & IDEs

Your editor is where you'll spend most of your time. Here are the most popular options on Linux.

VS Code (the crowd favorite)

Visual Studio Code is by far the most popular editor for developers. It's lightweight, has a massive extension ecosystem, and supports basically every language.

Install via Flatpak (works on any distro):

flatpak install flathub com.visualstudio.code

Or add Microsoft's official repo (Ubuntu/Debian):

# Import the Microsoft GPG key and repo
sudo apt install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list

sudo apt update
sudo apt install code

On Fedora:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo
sudo dnf install code

On Arch, you can grab the open-source build from the official repos or the full version from the AUR:

# Open-source build (no Microsoft telemetry)
sudo pacman -S code

# Or the full Microsoft version via AUR
yay -S visual-studio-code-bin
Tip: If you care about privacy, check out VSCodium — it's VS Code without Microsoft's telemetry and branding.

Neovim (for the adventurous)

Neovim is a modern fork of Vim — a terminal-based editor that's incredibly fast and endlessly configurable. The learning curve is steep, but many developers swear by it once they've gotten over the hump.

# Ubuntu/Debian
sudo apt install neovim

# Fedora
sudo dnf install neovim

# Arch
sudo pacman -S neovim

If you want a pre-configured Neovim setup instead of building your own, look into LazyVim, AstroNvim, or NvChad.

Other solid options

Git Setup

Git is the version control system used by essentially every developer. If you're going to write code, you need Git.

1. Install Git

# Ubuntu/Debian
sudo apt install git

# Fedora
sudo dnf install git

# Arch
sudo pacman -S git

2. Configure your identity

Git attaches your name and email to every commit you make. Set these to match your GitHub (or GitLab) account:

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

A couple of other useful settings while you're at it:

# Set the default branch name to "main" (instead of "master")
git config --global init.defaultBranch main

# Use a nicer diff output
git config --global diff.colorMoved default

3. Set up an SSH key for GitHub

SSH keys let you push and pull from GitHub without typing your password every time. Here's how to set one up:

# Generate a new SSH key (hit Enter to accept defaults when prompted)
ssh-keygen -t ed25519 -C "you@example.com"

# Start the SSH agent
eval "$(ssh-agent -s)"

# Add your key to the agent
ssh-add ~/.ssh/id_ed25519

# Copy your public key to the clipboard
# (install xclip first if you don't have it: sudo apt install xclip)
xclip -selection clipboard < ~/.ssh/id_ed25519.pub

Now go to GitHub → Settings → SSH and GPG keys, click New SSH key, and paste your key. Give it a name like "Linux laptop" and save.

Test the connection:

ssh -T git@github.com
# You should see: "Hi username! You've successfully authenticated..."
Tip: When cloning repos, use the SSH URL (starts with git@github.com:) instead of the HTTPS one. That way Git uses your SSH key automatically.

Programming Languages

Click a language below to see how to set it up on Linux.

Python

Good news: Python comes pre-installed on almost every Linux distro. Check your version:

python3 --version

pip is Python's package manager for installing libraries:

# Install pip if you don't have it
sudo apt install python3-pip    # Ubuntu/Debian
sudo dnf install python3-pip    # Fedora

# Install a library
pip install requests

Virtual environments keep each project's dependencies separate (you really should use these):

# Create a virtual environment in your project folder
python3 -m venv .venv

# Activate it
source .venv/bin/activate

# Now pip install goes into this environment only
pip install flask

# Deactivate when you're done
deactivate

pyenv lets you install and switch between multiple Python versions easily:

# Install dependencies first
sudo apt install build-essential libssl-dev zlib1g-dev \
  libbz2-dev libreadline-dev libsqlite3-dev curl git \
  libncursesw5-dev xz-utils tk-dev libxml2-dev \
  libxmlsec1-dev libffi-dev liblzma-dev

# Install pyenv
curl https://pyenv.run | bash

# Add to your shell config (~/.bashrc or ~/.zshrc)
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc

# Restart your shell, then:
pyenv install 3.12
pyenv global 3.12
Node.js (JavaScript / TypeScript)

Don't install Node from your distro's package manager — the version is usually outdated. Use nvm (Node Version Manager) instead. It lets you install and switch between Node versions effortlessly.

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# Restart your terminal, then install Node
nvm install --lts

# Verify
node --version
npm --version

Package managers for Node projects:

Tip: pnpm is becoming the go-to choice for many developers. It's faster than npm and yarn, and uses a content-addressable store so packages are shared across projects instead of duplicated.
Rust

Rust uses rustup, its official installer and version manager. This is the only way you should install Rust:

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

# Follow the prompts (default installation is fine)
# Then restart your terminal or run:
source "$HOME/.cargo/env"

# Verify
rustc --version
cargo --version

cargo is Rust's package manager and build tool. You'll use it for everything:

# Create a new project
cargo new my-project
cd my-project

# Build and run
cargo run

# Build for production
cargo build --release
Go

Go is available in most distro repositories:

# Ubuntu/Debian
sudo apt install golang

# Fedora
sudo dnf install golang

# Arch
sudo pacman -S go

Or download the latest version directly from go.dev:

# Download and extract (check go.dev for the latest version)
wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz

# Add to your PATH (~/.bashrc or ~/.zshrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc

# Verify
go version
Java

The open-source version of Java is called OpenJDK and it's available in every distro's repos:

# Ubuntu/Debian (installs the latest LTS version)
sudo apt install default-jdk

# Fedora
sudo dnf install java-latest-openjdk-devel

# Arch
sudo pacman -S jdk-openjdk

# Verify
java --version
javac --version

If you need to manage multiple Java versions, check out SDKMAN!:

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 21.0.2-tem
C / C++

The GNU Compiler Collection (GCC) is the standard C/C++ compiler on Linux. Most distros offer a meta-package that bundles the compiler with essential build tools:

# Ubuntu/Debian
sudo apt install build-essential

# Fedora
sudo dnf groupinstall "Development Tools"

# Arch
sudo pacman -S base-devel

# Verify
gcc --version
g++ --version
make --version

This gives you gcc (C compiler), g++ (C++ compiler), make, and other build essentials. If you also want Clang (an alternative compiler from the LLVM project):

sudo apt install clang        # Ubuntu/Debian
sudo dnf install clang         # Fedora
sudo pacman -S clang           # Arch

For build systems beyond Make, you might want CMake:

sudo apt install cmake         # Ubuntu/Debian
sudo dnf install cmake         # Fedora
sudo pacman -S cmake           # Arch

Docker

Docker lets you run applications in containers — lightweight, isolated environments that bundle an app with everything it needs to run. Think of it like a super-lightweight virtual machine. It's incredibly useful for development because:

Install Docker

Ubuntu / Debian
# Remove any old versions
sudo apt remove docker docker-engine docker.io containerd runc

# Set up Docker's official repository
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list

# Install Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Let your user run Docker without sudo
sudo usermod -aG docker $USER

# Log out and back in for the group change to take effect
Fedora
# Add Docker's repo
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

# Install Docker
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Start Docker and enable it on boot
sudo systemctl start docker
sudo systemctl enable docker

# Let your user run Docker without sudo
sudo usermod -aG docker $USER

# Log out and back in for the group change to take effect
Arch
sudo pacman -S docker docker-compose docker-buildx

# Start Docker and enable it on boot
sudo systemctl start docker
sudo systemctl enable docker

# Let your user run Docker without sudo
sudo usermod -aG docker $USER

# Log out and back in for the group change to take effect

Basic Docker usage

# Run a container (downloads the image if you don't have it)
docker run hello-world

# Run an interactive Ubuntu container
docker run -it ubuntu bash

# Run PostgreSQL in the background
docker run -d --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres

# See running containers
docker ps

# Stop a container
docker stop my-postgres

# Remove a container
docker rm my-postgres

# List downloaded images
docker images
Docker Compose lets you define multi-container setups in a YAML file. Need a web app with a database and a cache? Define them all in docker-compose.yml and run docker compose up. It's a lifesaver for local development.

Terminal Setup

The default terminal that comes with your desktop environment works fine, but if you want something faster, prettier, or more configurable, here are the popular picks.

Terminal emulators

TerminalWhat it's aboutInstall
Alacritty GPU-accelerated, minimal, configured via a YAML file. Fast as they come. sudo apt install alacritty
Kitty GPU-accelerated with more built-in features than Alacritty (tabs, splits, image display). sudo apt install kitty
WezTerm GPU-accelerated, configured via Lua. Built-in multiplexer (tabs, panes, workspaces). Download from wezterm.org or Flatpak

Shell upgrades

Your default shell is probably Bash. It works great, but there are alternatives with nicer defaults:

Zsh + Oh My Zsh — the most popular upgrade. Zsh is Bash-compatible but adds better autocompletion, theming, and plugin support. Oh My Zsh is a framework that makes configuring Zsh easy:

# Install Zsh
sudo apt install zsh       # Ubuntu/Debian
sudo dnf install zsh       # Fedora
sudo pacman -S zsh         # Arch

# Set Zsh as your default shell
chsh -s $(which zsh)

# Install Oh My Zsh (restart your terminal first)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Popular Zsh plugins worth adding: zsh-autosuggestions (suggests commands as you type based on history) and zsh-syntax-highlighting (colors valid commands green and invalid ones red).

Fish — the "friendly interactive shell." It has amazing autocompletion and syntax highlighting out of the box with zero configuration:

# Install Fish
sudo apt install fish       # Ubuntu/Debian
sudo dnf install fish       # Fedora
sudo pacman -S fish         # Arch

# Try it out
fish

# If you like it, set it as default
chsh -s $(which fish)
Heads up: Fish is not Bash-compatible. Some scripts written for Bash won't work in Fish. This usually isn't a problem day-to-day, but it's worth knowing.

Useful CLI Tools

These are the tools you'll see recommended constantly in dev circles. They're all worth installing.

ToolWhat it doesReplaces
htop Interactive process viewer. See what's eating your CPU and RAM at a glance. top
tmux Terminal multiplexer. Split your terminal into panes, create tabs, and keep sessions alive after disconnecting. Opening multiple terminal windows
ripgrep (rg) Search file contents blazingly fast. Respects .gitignore by default. grep
fzf Fuzzy finder. Search through files, command history, or anything else interactively. Ctrl+R history search
bat Like cat but with syntax highlighting, line numbers, and Git integration. cat
eza Modern replacement for ls with colors, icons, tree view, and Git status. ls

Install them all in one go:

# Ubuntu/Debian
sudo apt install htop tmux ripgrep fzf bat

# Fedora
sudo dnf install htop tmux ripgrep fzf bat

# Arch
sudo pacman -S htop tmux ripgrep fzf bat eza
Note: On Ubuntu/Debian, the bat binary is named batcat due to a naming conflict. You can alias it: alias bat='batcat' in your ~/.bashrc. For eza on Ubuntu, you may need to install it from the official instructions since it's not in the default repos on older releases.

Database Setup

You don't need to install databases directly on your system — Docker is usually the easier path (see above). But if you prefer native installs, here's a quick rundown.

PostgreSQL

The most popular database for serious projects. Powerful, reliable, and open source.

# Ubuntu/Debian
sudo apt install postgresql postgresql-contrib

# Start the service
sudo systemctl start postgresql
sudo systemctl enable postgresql

# Create a database user matching your Linux username
sudo -u postgres createuser --interactive

# Create a database
createdb myproject

MySQL / MariaDB

MariaDB is a drop-in replacement for MySQL and is what most distros ship. They work the same way.

# Ubuntu/Debian
sudo apt install mariadb-server

# Fedora
sudo dnf install mariadb-server

# Start and secure it
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation

SQLite

SQLite is a tiny database stored in a single file. No server needed — perfect for small projects, prototyping, and mobile apps. It's probably already installed on your system.

# Install if needed
sudo apt install sqlite3

# Create/open a database
sqlite3 myproject.db
Docker alternative: For development, running databases in Docker is often simpler. No system service to manage, easy to reset, and you can run multiple versions side by side. Example: docker run -d --name pg -e POSTGRES_PASSWORD=secret -p 5432:5432 postgres

What's Next?

With all this set up, you've got a seriously capable development machine. From here, you might want to: