Introduction / Why This Is Needed
A Development Environment is a set of tools that allows you to write, compile, test, and debug program code. Setting up a comfortable and efficient environment on Debian is the first step towards productive work. In this guide, you will learn how to fully set up a development environment from scratch, including the installation of compilers, package managers, programming languages, and IDEs.
Requirements / Preparation
Before you begin, make sure that:
- You have Debian 11 (bullseye) or Debian 12 (bookworm) installed. The instructions also apply to older versions, but package names may differ.
- You have an internet connection to download packages.
- You have superuser (sudo) privileges to install system packages.
- Basic knowledge of working in the terminal (navigation, file editing).
Step 1: Update the System and Install Basic Packages
First, update the package list and install basic utilities that will be needed later.
sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential curl wget gnupg2 software-properties-common
build-essentialincludes the GCC compiler, Make, and other build tools.curlandwgetare for downloading files from the internet.gnupg2is for working with GPG keys (e.g., when adding repositories).software-properties-commonallows adding PPAs (although this is less common in Debian, it can be useful).
Step 2: Install Compilers and Build Tools
The build-essential package already provides basic compilers, but some projects may require additional tools.
sudo apt install -y cmake autoconf automake libtool pkg-config
These packages are used for configuring and building projects, especially those written in C/C++.
Step 3: Install Git and Additional Utilities
Git is the standard for version control. Install it along with useful additions.
sudo apt install -y git git-flow
git-flowis a set of extensions to simplify working with branching according to the Git Flow model.
Step 4: Install Programming Languages
Depending on your needs, install one or more programming languages.
Python
Install Python 3, the pip package manager, and the virtual environment module:
sudo apt install -y python3 python3-pip python3-venv python-is-python3
The python-is-python3 package creates a symbolic link python → python3, which is useful for compatibility with scripts expecting python.
Node.js
To install the latest LTS version of Node.js, add the official NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
💡 Tip: If you already have Node.js installed from the Debian repository, remove it before adding NodeSource to avoid version conflicts:
sudo apt remove nodejs npm.
This will install Node.js and npm. For managing Node.js versions, using nvm is recommended (see Step 5).
Java
Install OpenJDK (version 11 or 17 is recommended):
sudo apt install -y openjdk-11-jdk
If you need a newer version, replace it with openjdk-17-jdk. Verify the installation with the java -version command.
Go
Install the Go compiler:
sudo apt install -y golang
After installation, you can check the version: go version.
Step 5: Install Language Version Managers (Optional)
Version managers allow you to easily switch between different versions of a language and isolate project dependencies.
pyenv (for Python)
Install pyenv to manage multiple Python versions:
curl https://pyenv.run | bash
Then add the settings to ~/.bashrc (or ~/.zshrc for Zsh):
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
⚠️ Important: pyenv requires additional dependencies to build Python from source. If you encounter errors when installing a Python version, install the dependencies:
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
Now you can install any Python version, for example: pyenv install 3.12.0.
nvm (for Node.js)
Install nvm to manage Node.js versions:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Restart the terminal or run source ~/.bashrc. Then install the desired Node.js version: nvm install --lts.
rustup (for Rust)
If you plan to work with Rust, install rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions. After installation, add to ~/.bashrc:
source "$HOME/.cargo/env"
Step 6: Install an IDE or Code Editor
For programming, you will need an editor or IDE. A popular choice is Visual Studio Code.
Visual Studio Code
Install VS Code from the official Microsoft repository:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install code
Alternatively, you can install it via snap: sudo snap install code --classic.
After installation, open VS Code and install extensions for your programming languages (e.g., Python, JavaScript, Go).
Step 7: Configure Environment Variables
Some tools (e.g., pyenv, nvm, rustup) require adding paths to the PATH variable. Make sure you have added the necessary settings to the ~/.bashrc (or ~/.profile) file, as shown in Step 5.
You can also add your own paths, for example, for custom scripts:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Verification
After completing the setup, make sure all tools are installed and accessible.
Run the following commands and check that the output shows versions:
gcc --version
make --version
git --version
python3 --version
node --version
java -version
go version
code --version
If each command outputs a version without errors, the development environment is ready for use.
Potential Issues
"command not found" error after installation
If a command (e.g., pyenv or nvm) is not found, restart the terminal or run source ~/.bashrc. Make sure you added the initialization to the correct file (for bash — ~/.bashrc, for Zsh — ~/.zshrc).
Packages not found when installing via apt
Make sure you ran sudo apt update after adding new repositories. Also, check that the repository is accessible (proxy configuration may be required).
Programming language version conflicts
Use version managers (pyenv, nvm, rustup) to isolate versions in each project. Avoid installing global versions via apt if you need different versions.
Insufficient disk space
Installing multiple languages and tools can run out of space. Free up space or use external drives. You can also clean the apt cache: sudo apt clean.
Permission issues
Use sudo to install system packages. If you are installing tools in your home directory (e.g., via pyenv), sudo privileges are not required.