Visual Studio Code (VS Code) has become an indispensable tool for developers across various platforms and programming languages. Its lightweight yet powerful nature, combined with an extensive ecosystem of extensions, makes it a top choice for coding, debugging, and version control. For users of Ubuntu, the leading Linux distribution, installing VS Code is a straightforward process, offering multiple methods to suit different preferences and technical needs. This guide will walk you through the most effective ways to get VS Code up and running on your Ubuntu system, ensuring you can start coding with this versatile IDE as quickly as possible.

Method 1: Installing VS Code via the Snap Store
One of the most recommended and user-friendly methods for installing VS Code on Ubuntu is through the Snap Store. Snaps are self-contained software packages that include all their dependencies, simplifying installation and updates. Ubuntu comes with Snap support pre-installed, making this a seamless experience.
1.1 Accessing the Snap Store
The Snap Store can be accessed in two primary ways on Ubuntu:
1.1.1 Using the Ubuntu Software Center (GUI)
The Ubuntu Software Center is a graphical interface for managing applications on your system.
- Open the Ubuntu Software Center: You can find it by searching for “Software” in the application menu or by clicking on the shopping bag icon in the dock.
- Search for “Visual Studio Code”: In the search bar at the top of the Software Center, type “Visual Studio Code” and press Enter.
- Select Visual Studio Code: The search results should display “Visual Studio Code” as the primary option. Click on it.
- Install: On the application page, you will see an “Install” button. Click this button. You might be prompted to enter your user password to authorize the installation.
- Launch: Once the installation is complete, you can launch VS Code from your application menu by searching for “Visual Studio Code”.
1.1.2 Using the Command Line (CLI)
For users who prefer the command line or are working on a server environment without a graphical interface, the Snap Store can be managed directly via the terminal.
- Open a Terminal: Press
Ctrl + Alt + Tor search for “Terminal” in the application menu. - Install VS Code: Execute the following command:
bash
sudo snap install --classic code
sudo: This command is used to run the installation with administrative privileges, which is necessary for installing software system-wide.snap install: This is the command to install a Snap package.--classic: This flag is important for VS Code. Many applications that need broader system access, like IDEs that interact with the file system and run executables, require the--classicconfinement. Without it, certain functionalities might be restricted.code: This is the package name for Visual Studio Code in the Snap Store.
- Enter Password: You will be prompted to enter your user password to confirm the installation.
- Launch: After the installation completes, you can launch VS Code by typing
codein the terminal or by searching for “Visual Studio Code” in your application menu.
Advantages of using Snap:
- Automatic Updates: Snaps are automatically updated in the background, ensuring you always have the latest version of VS Code with the newest features and security patches.
- Dependency Management: All necessary dependencies are bundled within the Snap package, eliminating potential conflicts with existing libraries on your system.
- Isolation: Snaps run in a confined environment, which enhances security by limiting their access to your system. However, the
--classicflag for VS Code provides the necessary permissions for a fully functional IDE.
Method 2: Installing VS Code via the APT Repository
Another widely adopted and robust method for installing VS Code on Ubuntu is by adding Microsoft’s official APT (Advanced Packaging Tool) repository to your system. This method ensures that you receive updates directly from Microsoft through Ubuntu’s standard package management system.
2.1 Adding the Microsoft APT Repository
This process involves downloading and installing Microsoft’s GPG key and then adding the repository to your system’s sources list.
- Update Package List: Before adding a new repository, it’s good practice to update your existing package lists to ensure you have the latest information about available packages. Open a terminal and run:
bash
sudo apt update
- Install Prerequisites: You’ll need a few packages to manage repositories and download keys. Install them with:
bash
sudo apt install software-properties-common apt-transport-https wget
- Download and Import Microsoft GPG Key: This key is used to verify the authenticity of the packages downloaded from Microsoft’s repository.
bash
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
wget -q ...: Downloads the GPG key quietly (-q).-O-: Outputs the downloaded content to standard output.| sudo apt-key add -: Pipes the output toapt-key add, which adds the key to your system’s trusted keys.
- Add the VS Code Repository: Now, add the official VS Code repository to your APT sources.
bash
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo add-apt-repository: This command adds a new repository to your system."deb [arch=amd64] ...": This specifies the repository type (deb), the architecture (amd64for most modern systems), the URL of the repository, and the distribution (stable) and component (main).
2.2 Installing VS Code
Once the repository has been added and your system’s package list is updated, you can install VS Code using APT.
- Update Package List Again: After adding a new repository, it’s crucial to update your package list to fetch information about the packages available from the newly added source.
bash
sudo apt update
- Install Visual Studio Code: Now you can install VS Code.
bash
sudo apt install code
sudo apt install code: This command fetches and installs thecodepackage from the configured repositories.
- Launch: After installation, VS Code can be launched by typing
codein the terminal or by finding “Visual Studio Code” in your application menu.
Advantages of using APT repository:
- Standard Ubuntu Experience: Integrates seamlessly with Ubuntu’s package management system.
- Direct Updates: Updates are delivered via
sudo apt upgrade, providing a familiar update process. - Control over Updates: You have more direct control over when updates are applied compared to the automatic nature of Snaps.

Method 3: Installing VS Code from a .deb Package
For users who prefer to manage installations manually or need a specific version not readily available through other methods, downloading and installing a .deb package is an option. This method involves downloading the VS Code installer file directly from the official website.
3.1 Downloading the .deb Package
- Visit the VS Code Website: Open your web browser and navigate to the official Visual Studio Code download page: https://code.visualstudio.com/Download.
- Select Linux: On the download page, you will see options for different operating systems. Click on the “Linux” tab.
- Choose .deb: Within the Linux options, you will find
.deband.rpmpackages. Click the button for the.debpackage (usually labeled for Debian/Ubuntu). - Save the File: Your browser will prompt you to save the file. Choose a location, such as your “Downloads” folder, and save the
.debfile.
3.2 Installing the .deb Package
After downloading the .deb file, you can install it using either the graphical package installer or the command line.
3.2.1 Using the Graphical Package Installer (GUI)
- Locate the Downloaded File: Open your file manager and navigate to the folder where you saved the
.debfile (e.g., your “Downloads” folder). - Double-Click the .deb File: Double-clicking the
.debfile will typically open it with the Ubuntu Software Center or a similar graphical package installer. - Install: The installer will display information about VS Code. Click the “Install” button. You will be prompted to enter your user password to authorize the installation.
- Launch: Once installed, you can launch VS Code from your application menu.
3.2.2 Using the Command Line (CLI)
- Open a Terminal: Press
Ctrl + Alt + Tor search for “Terminal”. - Navigate to the Download Directory: Change your directory to where you downloaded the
.debfile. For example, if it’s in your “Downloads” folder:
bash
cd ~/Downloads
- Install the Package: Use the
dpkgcommand to install the.debfile. Replacecode_*.debwith the exact name of the downloaded file.
bash
sudo dpkg -i code_*.deb
sudo dpkg -i: This command installs a Debian package.code_*.deb: This is a wildcard to match the downloaded VS Code.debfile. It’s often more precise to type the full filename.
- Resolve Dependencies (if necessary): Sometimes, installing a
.debpackage might result in dependency errors if required libraries are missing. You can fix these with the following command:
bash
sudo apt --fix-broken install
This command will fetch and install any missing dependencies. - Launch: After successful installation, launch VS Code by typing
codein the terminal or by searching for it in the application menu.
Advantages of using .deb package:
- Offline Installation: Useful if you have limited internet access during installation.
- Manual Control: Gives you complete control over the installation process.
- Specific Versions: Allows you to download and install a particular version of VS Code.
Note: When installing via a .deb package, you will not automatically receive updates unless you manually download and install new versions or add the APT repository as described in Method 2.
Post-Installation: Getting Started with VS Code on Ubuntu
Regardless of the installation method you choose, the experience of using VS Code on Ubuntu is consistent. Upon launching VS Code, you’ll be greeted with a clean, modern interface.
4.1 Exploring the User Interface
The VS Code interface is designed for efficiency:
- Activity Bar: Located on the far left, this bar provides quick access to essential views like Explorer, Search, Source Control, Run and Debug, and Extensions.
- Sidebar: This area adapts based on the view selected in the Activity Bar. For example, when the Explorer is active, it shows your project’s file tree.
- Editor Group: The main central area where you open and edit files. You can split this area to view and edit multiple files side-by-side.
- Panel: Typically located at the bottom, this area houses the Terminal, Output, Debug Console, and Problems views.
- Status Bar: At the very bottom, it displays useful information such as the current branch, line and column number, language mode, and errors/warnings.
4.2 Installing Extensions
The true power of VS Code lies in its vast extension marketplace. Extensions can add new languages, debuggers, themes, and tools, tailoring the IDE to your specific workflow.
- Open the Extensions View: Click on the Extensions icon in the Activity Bar (it looks like four squares, with one detached) or press
Ctrl + Shift + X. - Search for Extensions: Use the search bar to find extensions. Popular choices include linters (like ESLint for JavaScript), formatters (like Prettier), language support packs (e.g., Python, Go, Docker), GitLens, and Live Server.
- Install Extensions: Click the “Install” button next to the extension you wish to add.

4.3 Configuring User Settings
VS Code allows for extensive customization through its settings.
- Access Settings: Go to “File” > “Preferences” > “Settings” or press
Ctrl + ,. - User vs. Workspace Settings: Settings can be applied globally for all projects (User Settings) or on a per-project basis (Workspace Settings).
- Search and Modify: The settings interface allows you to search for specific options (e.g., font size, theme, tab size) and modify them directly using the provided input fields or checkboxes. Settings are stored in JSON files, which you can also edit directly for more advanced configurations.
By following these installation methods and exploring the initial setup, you are well on your way to leveraging Visual Studio Code as a powerful and efficient development environment on your Ubuntu system. The flexibility and extensibility of VS Code, combined with the robust nature of Ubuntu, create a formidable platform for any developer.
