Setting Up a Productive Dev Environment on Ubuntu
#ubuntu
#dev-environment
#workflow
#linux
Overview
Setting up a productive dev environment on Ubuntu is about reliability, speed, and a comfortable workflow. This guide walks through choosing a baseline distro, updating the system, configuring the shell, picking an editor, and establishing a few productivity boosters that scale with your projects.
Prerequisites
- An Ubuntu machine (22.04 LTS or newer) or a fresh Ubuntu install of version 24.04+.
- A user with sudo privileges.
- A stable internet connection for downloading packages.
- Basic familiarity with the terminal.
System baseline and updates
Run a baseline update and install essential tools:
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential curl file git ca-certificates
Optional: enable unattended upgrades to keep the system secure:
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
Shell and terminal
A fast, expressive shell improves productivity. This setup uses Zsh with a modern prompt.
sudo apt install -y zsh
# make zsh your default shell
chsh -s /usr/bin/zsh
Optional: try a modern prompt with Starship (works with Bash, Zsh, Fish):
curl -fsSL https://starship.rs/install.sh | sh
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
Optional: you can enhance Zsh with suggestions and syntax highlighting later, but keeping the initial setup lightweight is fine.
Editor and tooling
A capable editor is central to productivity. This setup uses Neovim as a lightweight, capable editor with a modern plugin ecosystem.
sudo apt install -y neovim python3-venv python3-pip curl
Install Python support for Neovim:
pip3 install --user pynvim
Minimal Neovim config (init.lua) you can start with:
mkdir -p ~/.config/nvim
cat > ~/.config/nvim/init.lua << 'EOS'
vim.opt.number = true
vim.opt.relativenumber = true
vim.cmd('set mouse=a')
EOS
For faster navigation and search, install:
sudo apt install -y ripgrep fd-find bat
Note: On Ubuntu, the fd binary is installed as fdfind; you can add an alias:
echo "alias fd=fdfind" >> ~/.zshrc
Optional: set up a JSON-configured LSP for Neovim using pyright or clangd, depending on your language focus.
Productivity boosters and dotfiles
Centralize your personal configurations to preserve consistency across machines.
- Aliases and functions (add to ~/.zshrc)
cat >> ~/.zshrc << 'EOS'
# Productivity aliases
alias ll='ls -la'
alias gs='git status'
alias ga='git add'
aliasgc='git commit'
EOS
- A simple Git workflow
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global core.editor "nvim"
git config --global pull.rebase true
- SSH keys for Git hosting
ssh-keygen -t ed25519 -C "you@example.com"
# press enter for file location, enter a passphrase if you want
# add the public key to your Git hosting service
Workflow tips for speed and reliability
- Use stable package mirrors and enable faster DNS by using a reliable resolver.
- Add a small, reproducible bootstrapping script to automate your setup across devices later.
- Keep dotfiles in a Git repository to track changes over time.
Troubleshooting common issues
- If commands are not found after installing, try restarting your shell or source your config: source ~/.zshrc
- If Neovim won’t start, check that Python support is installed: python3 -c “import sys; print(sys.version)”
- When lag occurs, check disk health and available RAM; consider enabling zram for better performance on laptops.
Conclusion
With a clean baseline, a modern shell, a productive editor, and a few automation habits, you’ll be able to focus on tasks rather than environment fiddling. Revisit this setup periodically to incorporate new tools and workflows that align with your projects.