How to Install Visual Studio Code on Linux: A Complete Guide for Developers
Learn how to install Visual Studio Code on Linux using the command line. Follow step-by-step guides for Ubuntu, Fedora, and other distributions. Get started quickly with official packages, Snap, or Flatpak for a seamless development experience.
Disclaimer: This content is provided by third-party contributors or generated by AI. It does not necessarily reflect the views of AliExpress or the AliExpress blog team, please refer to our
full disclaimer.
People also searched
<h2> What Is Visual Studio Code and Why Is It Popular on Linux? </h2> <a href="https://www.aliexpress.com/item/1005009075542676.html"> <img src="https://ae-pic-a1.aliexpress-media.com/kf/S904adcef20ae47e4a5cf076bd2718a67Z.jpg" alt="OV3660 USB Camera Module Support-OTG 1080P 3MP Video Camera Module 64°/3.5mm Manual-Focus Lens MJPG/YUY2 for Face Recognition"> </a> Visual Studio Code, commonly known as VS Code, is a lightweight yet powerful source-code editor developed by Microsoft. It supports a wide range of programming languages, including JavaScript, Python, C++, HTML, CSS, and more, making it a go-to tool for developers across different domains. One of the key reasons for its popularityespecially among Linux usersis its seamless integration with open-source tools, robust extension ecosystem, and native support for Linux distributions such as Ubuntu, Debian, Fedora, and CentOS. For developers working on Linux systems, installing Visual Studio Code is not just about getting a code editorit’s about gaining access to a full-featured development environment that enhances productivity. Unlike heavier IDEs like Eclipse or IntelliJ IDEA, VS Code starts quickly, uses minimal system resources, and offers real-time syntax highlighting, intelligent code completion, debugging tools, and Git integrationall out of the box. These features are particularly valuable in Linux environments where developers often rely on command-line tools and automation. Moreover, VS Code’s extensibility allows users to tailor the editor to their specific workflow. Whether you're building web applications with React, developing backend services in Node.js, or working on machine learning projects with Python, there’s an extension available to support your needs. The extension marketplace is vast and actively maintained, with thousands of community-contributed tools that enhance functionality. Another major advantage of using VS Code on Linux is its compatibility with remote development. With the Remote-SSH, Remote-WSL, and Remote-Containers extensions, developers can work directly on remote servers or containerized environments without needing to transfer files manually. This capability is especially useful for DevOps engineers, cloud developers, and those managing Linux-based infrastructure. The installation process itself is straightforward and well-documented. Whether you're using a Debian-based system like Ubuntu or a Red Hat-based distribution like Fedora, Microsoft provides official packages and repositories to simplify setup. You can install VS Code via the command line using apt,yum, or dnf, or download the .deb or .rpm package directly from the official website. Additionally, Snap and Flatpak versions are available for users who prefer sandboxed application delivery. For Linux users who value open-source principles, it’s worth noting that VS Code is built on Electron, which is also open source. While the core editor is free to use, Microsoft offers premium features through extensions and services like GitHub Copilot, which can be integrated into the editor. However, the base functionality remains completely free and accessible to all. In summary, Visual Studio Code is more than just a code editorit’s a complete development platform that fits perfectly into the Linux ecosystem. Its performance, flexibility, and strong community support make it one of the most widely adopted tools among Linux developers worldwide. <h2> How to Install Visual Studio Code on Linux Using the Command Line </h2> <a href="https://www.aliexpress.com/item/1005007433197702.html"> <img src="https://ae-pic-a1.aliexpress-media.com/kf/S71468c66cb6743398c753051bd0141946.png" alt="4K WiFi Camera 8MP Panoramic 180 Degree VR IP Camera sony IMX415 Cam IR light night vision Outdoor Security Camera Wireless XM"> </a> Installing Visual Studio Code on Linux via the command line is one of the most efficient and automated methods, especially for developers who prefer working in terminal environments. The process varies slightly depending on your Linux distribution, but the general steps remain consistent across Debian-based (e.g, Ubuntu, Linux Mint) and Red Hat-based (e.g, Fedora, CentOS) systems. For Debian or Ubuntu users, the first step is to update your package list to ensure you’re working with the latest repository information. Open your terminal and run: bash sudo apt update Next, install the required dependencies for adding a new repository. You’ll needcurlandgnupg: bash sudo apt install -y curl gnupg Now, download and add Microsoft’s GPG key to your system to verify the authenticity of the packages:bash curl -fsSLhttps://packages.microsoft.com/keys/microsoft.asc| sudo gpg -dearmor -o /usr/share/keyrings/microsoft.gpg After that, add the official Visual Studio Code repository to your system’s sources list. Create a new file in /etc/apt/sources.list.d: bash echo deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg]https://packages.microsoft.com/repos/codestable main | sudo tee /etc/apt/sources.list.d/vscode.list Once the repository is added, update your package list again: bash sudo apt update Now, install Visual Studio Code using theaptpackage manager:bash sudo apt install -y code After installation, you can launch VS Code by typing code in the terminal or by searching for it in your desktop environment’s application menu. For users on Fedora or CentOS, the process is similar but uses dnf instead of apt. First, install the required tools:bash sudo dnf install -y curl gpg Then, download and add the Microsoft GPG key: bash curl -fsSLhttps://packages.microsoft.com/keys/microsoft.asc| sudo gpg -dearmor -o /etc/pki/rpm-gpg/RPM-GPG-KEY-microsoft Create a repository file for VS Code: bash sudo tee /etc/yum.repos.d/vscode.repo << EOF [vscode] name=Visual Studio Code baseurl=https://packages.microsoft.com/yumrepos/vscode enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc EOF ``` Update the package cache and install VS Code: ```bash sudo dnf check-update sudo dnf install -y code ``` Once installed, you can launch it from the terminal or desktop launcher. For users who prefer Snap packages, you can install VS Code directly via: ```bash sudo snap install --classic code ``` This method is ideal for users on Ubuntu or other distributions that support Snap. It ensures automatic updates and sandboxed execution. Regardless of the method, after installation, you can verify the version by running: ```bash code --version ``` This command will display the installed version of VS Code, confirming a successful setup. Using the command line not only streamlines the installation but also integrates well with automation scripts, CI/CD pipelines, and remote server setups. It’s the preferred method for developers who manage multiple machines or work in headless environments. <h2> How to Choose the Right Linux Distribution for Running Visual Studio Code? </h2> <a href="https://www.aliexpress.com/item/1005007989425031.html"> <img src="https://ae-pic-a1.aliexpress-media.com/kf/S5503abdccd9e448a93493ee4b1a7d512D.png" alt="Wifi Camera Module ESP32-S3 Image Transmission FOR ROS Robot Car Trolley AI Visual Recognition Sensor Vision Recognition Camera"> </a> Choosing the right Linux distribution for running Visual Studio Code depends on your development needs, system preferences, and workflow. While VS Code runs on virtually all major Linux distributions, some are better suited for specific use cases than others. Ubuntu is arguably the most popular choice for developers using VS Code. It offers long-term support (LTS) versions, a vast software repository, excellent community support, and strong compatibility with both desktop and server environments. Its user-friendly interface and widespread adoption make it ideal for beginners and professionals alike. Additionally, Ubuntu’s support for Snap packages simplifies the installation and update process for VS Code. Debian is another solid option, especially for users who prioritize stability and security. It’s known for its conservative update cycle, which reduces the risk of breaking changes. However, the software versions in Debian’s default repositories may be older than those in Ubuntu, so you might need to manually add the Microsoft repository for the latest VS Code version. For developers who prefer a rolling release model with up-to-date software, Arch Linux and its derivatives (like Manjaro) are excellent choices. These distributions provide the latest versions of tools and libraries, which can be beneficial when working with cutting-edge development frameworks. However, they require more technical knowledge to maintain and troubleshoot. Fedora is a favorite among developers who value innovation and open-source principles. It’s backed by Red Hat and often includes the latest versions of development tools. Fedora’s strong integration with systemd and DNF package manager makes it a reliable platform for server-side development and containerized applications. CentOS Stream, a community-driven rebuild of Red Hat Enterprise Linux (RHEL, is ideal for enterprise-level development and production environments. It offers long-term stability and security updates, making it suitable for teams managing critical infrastructure. If you’re working with containers or cloud-native applications, distributions like RancherOS or CoreOS (now part of Red Hat’s OpenShift) are designed specifically for containerized workloads and integrate seamlessly with Docker and Kubernetesboth of which work well with VS Code via remote development extensions. For users who want a lightweight, minimal system, Linux distributions such as Alpine Linux or Lubuntu are worth considering. While they may require additional configuration to run GUI applications like VS Code, they’re perfect for resource-constrained environments or embedded systems. Ultimately, the best Linux distribution for VS Code depends on your specific needs: stability vs. cutting-edge features, ease of use vs. customization, and desktop vs. server usage. Most developers find that Ubuntu or Fedora strike the ideal balance between performance, support, and compatibility. <h2> What Are the Best Extensions for Visual Studio Code on Linux? </h2> <a href="https://www.aliexpress.com/item/1005005367958827.html"> <img src="https://ae-pic-a1.aliexpress-media.com/kf/Sf9c745eef6394815be3f24f639861680m.jpg" alt="EVICIV Triple Portable Monitor for Laptop 14'' 2K 1440P USB-C Laptop Screen Extender IPS Computer Display for Wins Chrome Mac"> </a> Visual Studio Code’s true power lies in its extensibility. With thousands of extensions available, developers can customize their environment to suit any programming language, framework, or workflow. On Linux, where developers often work with command-line tools, containers, and remote servers, the right extensions can dramatically improve productivity. One of the most essential extensions for Linux developers is the Remote SSH extension. It allows you to connect to remote Linux machines over SSH and edit files directly on the server as if they were local. This is invaluable for DevOps engineers, backend developers, and anyone managing cloud infrastructure. Combined with the Remote WSL extension, you can seamlessly work within the Windows Subsystem for Linux (WSL) environment, making it a powerful hybrid development setup. For Python developers, the Python extension by Microsoft is a must-have. It provides IntelliSense, linting, debugging, Jupyter notebook support, and integration with virtual environmentsall critical for data science and machine learning workflows. It works flawlessly on Linux and integrates with popular libraries like NumPy, Pandas, and TensorFlow. JavaScript and TypeScript developers should install the ESLint and Prettier extensions. These tools enforce code style consistency and catch errors before runtime. They integrate with popular frameworks like React, Vue, and Angular, making them essential for modern web development. If you’re working with Docker, the Docker extension is indispensable. It allows you to build, run, and manage containers directly from VS Code, view container logs, and inspect imagesall without leaving the editor. This is especially useful for Linux users who rely heavily on containerization. For version control, the GitLens extension enhances Git functionality with features like blame annotations, code authorship insights, and visual commit history. It’s particularly helpful when collaborating on open-source projects hosted on GitHub or GitLab. Frontend developers will benefit from the Live Server extension, which starts a local development server with live reload capabilities. This is perfect for testing HTML, CSS, and JavaScript changes in real time. Security-conscious developers may want to install Code Spell Checker to catch typos in comments and documentation, and Bracket Pair Colorizer to improve code readability by highlighting matching brackets. Finally, the GitHub Copilot extension, powered by AI, suggests entire lines or blocks of code based on context. While it’s a paid service, it can significantly speed up development, especially for repetitive or boilerplate code. These extensions, combined with VS Code’s built-in features, make it one of the most powerful and flexible development environments available on Linux today. <h2> How Does Visual Studio Code Compare to Other Code Editors on Linux? </h2> <a href="https://www.aliexpress.com/item/1005005073152360.html"> <img src="https://ae-pic-a1.aliexpress-media.com/kf/Sd14b2829347d4e97bfd411f5eb4a2dc2E.jpg" alt="Spedal 934 Hd 1080P 60fps Usb Streaming Webcam with Microphone for Computer Meeting Web Camera Windows Mac Linux"> </a> When comparing Visual Studio Code to other code editors on Linux, such as Vim, Emacs, Sublime Text, or Atom, several key differences emerge in terms of usability, performance, extensibility, and target audience. Vim and Emacs are terminal-based editors with steep learning curves but unmatched efficiency for experienced users. They are lightweight, fast, and ideal for remote server work. However, they lack the visual interface and built-in debugging tools that modern developers expect. VS Code, in contrast, offers a full GUI, real-time syntax highlighting, and integrated terminalmaking it more accessible to beginners and intermediate developers. Sublime Text is known for its speed and minimalistic design. It’s fast and responsive, even on older hardware. However, it’s a proprietary tool with a limited free trial, and its extension ecosystem is not as rich or actively maintained as VS Code’s. Additionally, Sublime Text lacks native support for remote development and advanced debugging features. Atom, another open-source editor by GitHub, was once a strong competitor to VS Code. It offered a similar extension model and was highly customizable. However, it was built on Electron and suffered from high memory usage and slower performance. Microsoft discontinued Atom in 2022, shifting focus entirely to VS Code, which now inherits its best features and more. VS Code stands out due to its balance of performance, features, and community support. It’s free, open-source (with some proprietary components, and actively developed. Its integration with Git, debugging tools, and remote development capabilities sets it apart from most alternatives. In terms of resource usage, VS Code is heavier than Vim or Emacs but lighter than full IDEs like Eclipse or IntelliJ IDEA. On modern Linux systems, this trade-off is well worth it for the enhanced productivity. Ultimately, VS Code is the preferred choice for most developers on Linux because it combines the power of a full IDE with the speed and simplicity of a lightweight editormaking it the gold standard in modern software development.