Home Ubuntu Setting up a local development environment on Ubuntu

Setting up a local development environment on Ubuntu

Creating a local development environment on Ubuntu is crucial for efficient coding and testing. This guide walks you through setting up essential development tools, configuring your system, and creating a productive workspace, ensuring a smooth and effective development process on your Ubuntu machine.

by Tony Gidraph
setting up a local development environment on ubuntu

As a developer, your local development environment is like your personal workshop, where you create and test your software projects. It’s where you turn your ideas into reality. And just like an artist chooses the right canvas for their masterpiece, developers need the right environment for their code.

Among different operating systems, Ubuntu stands out as a popular choice for developers. It’s open-source, which means you have more control over it. It’s also powerful and reliable, so you can focus on coding instead of worrying about technical issues. And it has a lot of tools and features specifically designed for developers.

In this guide, we’ll show you how to set up your own Ubuntu development environment, step by step. By the end, you’ll have a personalized workspace that’s perfect for bringing your code to life.

Reasons why Linux is a great choice for developers

Here are some reasons why developers might prefer Linux for development.

1. Open source philosophy

Linux is open-source, which means that developers have access to the source code and can modify it according to their needs. This aligns well with the ethos of many developers who appreciate the freedom and transparency that open-source software provides.

2. Command line tools

Linux provides a powerful command line interface (CLI) that developers often find more robust and flexible than the Windows command prompt. Many development tasks, automation scripts, and server configurations are more efficiently handled through the command line.

3. Package management

Linux distributions typically come with advanced package management systems (e.g apt for Ubuntu) that make it easy to install, update, and manage software packages. This is particularly beneficial for setting up development environments.

4. Developer-friendly tools and libraries

Many development tools, libraries, and frameworks are first released or better supported on Linux. For example, technologies like Docker, Kubernetes, and various programming language runtimes often have more seamless integration and performance on Linux.

5. Performance and resource efficiency

Linux is often considered more lightweight and resource-efficient compared to Windows. This can be advantageous for development tasks, especially on machines with limited resources.

6. Scripting and automation:

The Linux shell is powerful and supports scripting languages like Bash. This makes it easier for developers to automate repetitive tasks and create complex workflows.

7. Security and stability

Linux is known for its security features and stability. The separation of user privileges and the robust permission system contribute to a more secure development environment. Additionally, Linux systems are less prone to crashes and slowdowns compared to Windows.

8. Community support

The Linux community is large and active, providing extensive online resources, forums, and documentation. Developers often find it easier to get support and solutions to problems when using Linux.

Setting up a local development environment on Ubuntu

Follow the steps below to set up a Local Development Environment on Ubuntu.

Step 1. Update package manager:

Before installing a new package on Ubuntu, you are highly recommended to update the package manager to refresh the local package index. This ensures the system has the latest information on available packages, security updates, and dependencies. It also checks for changes in software repositories, allowing the package manager to make accurate installation decisions and maintain system security.

Execute the commands below.

sudo apt update
sudo apt upgrade

Step 2. Install essential development tools:

In the realm of development, equipping your Ubuntu machine with essential tools is paramount for a seamless coding experience. These tools lay the groundwork for efficient coding, version control, and building applications. Here, we’ll guide you through the installation of crucial development tools to fortify your Ubuntu environment.

Git: Git is a distributed version control system that allows developers to track changes in their source code efficiently. With features like branching, merging, and collaboration support, Git is essential for managing project versions and facilitating seamless collaboration among developers.

sudo apt install git
install git

Install Git

curl: curl is a versatile command-line tool used for making HTTP requests. Whether fetching data from APIs or downloading files, curl simplifies interactions with web services. Its flexibility and support for various protocols make it indispensable for web developers and system administrators alike.

sudo apt install curl
install curl

Install curl

build-essential: The build-essential package provides a fundamental set of tools required for compiling and building software on Ubuntu. It includes essential components such as compilers (like GCC), libraries, and build-related utilities. Installing build-essential is a crucial step before compiling code from the source or installing software that requires compilation.

sudo apt install build-essential
install build essentials

Install build-essentials

wget: wget is a command-line utility for downloading files from the web. Its simplicity and robustness make it a handy tool for retrieving files, and it supports downloading files via HTTP, HTTPS, and FTP protocols. wget is particularly useful for automating file downloads in scripts and workflows.

sudo apt install wget
install wget

Install wget

Step 3. Install a text editor or IDE:

Next step, you will need to install a text editor or integrated development environment (IDE) that suits your preferences. Let’s look at some of the popular choices available.

Web development
  • Visual Studio Code (VSCode): VSCode is a highly popular, free, and open-source editor developed by Microsoft with a rich set of extensions. You can download the Visual Studio Code installation package (deb file) from their official website. Alternatively, check out our comprehensive post on How to install Microsoft Visual Studio Code on Linux.
  • Sublime Text: Known for its speed and simplicity, Sublime Text is a versatile text editor with a lot of customization options. Use the commands below to install Sublime Text on Ubuntu.
    wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null

    echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

    sudo apt update

    sudo apt install sublime-text
    install sublime text

    Install Sublime Text


    If you encounter any error, run the command below to ensure apt is setup to work with https sources.
    sudo apt-get install apt-transport-https
    Also, check out our article on 10 Tips on mastering Sublime Text Editor.
  • Brackets: A lightweight, yet powerful, modern text editor. It’s particularly popular among front-end web developers. Use the commands below to install Brackets on Ubuntu.
    sudo apt update
    sudo apt install snapd
    sudo snap install brackets --classic
    install brackets

    Install Brackets

  • WebStorm: Developed by JetBrains, WebStorm is an IDE specifically designed for JavaScript, TypeScript, and other web technologies. Launch the terminal and execute the commands below to install WebStorm on Ubuntu.
    sudo apt update
    sudo apt install snapd
    sudo snap install webstorm --classic
    install webstorm

    Install Webstorm


    Alternatively, you can check out our article How to install and use WebStorm on Ubuntu for our comprehensive guide.
Python
  • PyCharm: PyCharm is a powerful IDE developed by JetBrains and specifically designed for Python development. It has a community edition that is free and open source. Please check out our article – The guide to Installing and using PyCharm on Ubuntu for a comprehensive guide on how to install and use Pycharm on Ubuntu.
  • Jupyter Notebooks: While not a traditional IDE, Jupyter Notebooks is a web-based platform widely used for interactive Python development, especially in data science. Jupyter Notebooks are like documents where you can execute chunks of code one chunk at a time. You can get started with Jupyter Notebooks by visiting their official website.

4. Set up version control:

If you are serious about getting into development, then you need to learn about version control. Version control systems enable you to monitor, track and manage changes in your code with ease. One of the most popular version control system is Git.

We discussed how to install Git in Step 2 above. After a successful installation, you need to configure Git and set up your Github username and email. Use the commands below.

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

These configurations are essential because Git uses them to record the authorship of each commit. When you make a commit, Git includes this information in the commit metadata, allowing others to see who made the changes.

Step 5. Install programming languages and databases

Next, you need to install a programming language of your choice.

  • Python: Python3 comes pre-installed on most Ubuntu versions. You can verify that by running the –version command below.
    python3 --version
    python version

    Python version


    If it’s not installed, use the command below to install Python on Ubuntu.
    sudo apt install python3 python3-pip
  • Java: If you are a Java developer, please check out our post on How to install different versions of Java on Ubuntu. It will also guide you in installing different versions of OpenJDK and setting up environmental variables.
  • NodeJS and NPM: If you are a web developer, there is a high chance you will need to use NodeJS at some point. Check out our comprehensive post on How to install Node.js and NPM packages on Ubuntu.
  • C and C++: If you are a C or C++ developer, there are times when you might need to use different compiler versions for your projects. Check out our post and learn how to install multiple versions of GCC and G++ on your Ubuntu system – How to install multiple versions of GCC and G++ on Ubuntu 20.04.
  • LAMP stack: LAMP is an acronym for Linux, Apache, MySQL, and PHP. If you are a PHP developer there is a high chance you will need these technologies to develop a web application. Please check out our post – How to install phpMyAdmin with LAMP stack on Ubuntu to get started.

Conclusion

This guide has given you a comprehensive guide on how to set up a local development environment on Ubuntu. It has shown you how to install various development tools, programming languages, version control systems and databases. However, you don’t need to install all the technologies described here, install only those that you need for your project. For example, if you are a NodeJS developer, you don’t have to setup Java or C++ on your system.

Have you come across any issues? Or do you have a suggestion on something you feel was left behind in this post? Please let us know in the comments below.

You may also like

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.