Linux for Developers: Setting Up a Complete Development Environment
Introduction
Linux has long been a favorite environment for developers due to its versatility, open-source nature, and customizability. In this blog post, we’ll guide you through setting up a fully functional development environment on Linux that includes essential tools and software to get you coding efficiently.
Prerequisites
Before proceeding, ensure you have:
- A Linux distro installed (Ubuntu is popular for beginners)
- Internet connectivity
- Basic knowledge of the Linux terminal
Step 1: Update Your System
Before starting the setup, it’s essential to make sure your system is up-to-date. Run the following commands in the terminal:
data@sherpa:~$ sudo apt update
data@sherpa:~$ sudo apt upgrade
Step 2: Install Development Tools
1. Installing Git
Git is a version control system critical for any developer. Install it using:
data@sherpa:~$ sudo apt install git
Configure Git with your information:
data@sherpa:~$ git config --global user.name "Your Name"
data@sherpa:~$ git config --global user.email "your.email@example.com"
2. Installing Build-Essential
This package will include the GCC compiler and other utilities necessary for building C/C++ applications:
data@sherpa:~$ sudo apt install build-essential
3. Installing Node.js and npm
Node.js is essential for JavaScript development. Install the LTS version with:
data@sherpa:~$ sudo apt install nodejs
Install npm (Node Package Manager), which is often bundled with Node.js:
data@sherpa:~$ sudo apt install npm
Verify installations:
data@sherpa:~$ nodejs -v
data@sherpa:~$ npm -v
Step 3: Set Up Text Editor or IDE
Visual Studio Code
One of the most popular choices is Visual Studio Code, which can be installed by executing:
data@sherpa:~$ sudo snap install --classic code
Step 4: Database Setup
1. Installing MySQL
data@sherpa:~$ sudo apt install mysql-server
Once installed, secure your MySQL instance:
data@sherpa:~$ sudo mysql_secure_installation
2. Installing PostgreSQL
PostgreSQL is another robust database option:
data@sherpa:~$ sudo apt install postgresql postgresql-contrib
Step 5: Containerization with Docker
Docker allows you to package applications into containers. Install it using:
data@sherpa:~$ sudo apt install docker.io
Post-installation, start the Docker service and enable it to run at startup:
data@sherpa:~$ sudo systemctl start docker
data@sherpa:~$ sudo systemctl enable docker
Conclusion
With the tools and software installed as outlined in this guide, your Linux system is now a robust platform for software development. Whether working on web development projects or building software in C/C++, this setup should cater to most of your development needs. Happy coding!