How To Install Visual Studio Code On CentOS 8
Tags: linux, cloudnative
Published: 2021-05-29 07:15:59

Visual Studio Code is an open-source, lightweight and powerful code editor developed by Microsoft. It supports Linux, macOS and Windows, and runs on the Desktop operating system. It has a built-in support for Node.js, TypeScript and JavaScript. You can add other language support including, Python, Go, PHP, Java and C++ with the help of extensions. It has a lot of features including, debugging, Git control and GitHub, syntax highlighting, snippets, intelligent code completion and code refactoring.

In this tutorial, we will show you how to install Visual Studio Code On CentOS 8.


## Prerequisites

- A fresh CentOS 8 Desktop.
- A root password is configured on your server.

## Step 1 - Create Atlantic.Net Cloud Server

If you want to create a new VPS server, Login to your [Atlantic.Net Cloud Server](https://cloud.atlantic.net/?page=userlogin). Create a new [server](https://www.atlantic.net/cloud-hosting/how-to-create-new-atlantic-net-cloud-server/), choosing CentOS 8 as the operating system, with at least 2 GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged into your Ubuntu 20.04 server, run the following command to update your base system with the latest available packages.

```dnf update -y```

## Step 2 - Add Visual Studio Code Repository

By default, Visual Studio Code is not available in the CentOS 8 default repository. So you will need to add its repository to your system.

First, import the key with the following command:

```rpm --import https://packages.microsoft.com/keys/microsoft.asc```

Next, create a Visual Studio Code repo with the following command:

```nano /etc/yum.repos.d/vscode.repo```

Add the following lines:

```
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
```
Save and close the file when you are finished.

## Step 3 - Install Visual Studio Code

You can now install the Visual Studio Code package by running the following command:

```dnf install code -y```

Once the installation is completed, you can verify the installed package using the following command:

```rpm -qi code```

You should get the following output:
![visual studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/225zytghevnwocziu5kp.png)

## Step 4 - Open Visual Studio Code

At this point, Visual Studio Code is installed in your system. Now, open your Application manager and search for Visual Studio Code. You should see the Visual Studio Code launcher in the following page:

![Launch Visual studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dhw21f0sw8dzndlz9yn.png)

Click on Visual Studio Code icon to launch the Visual Studio Code. You should see the following page:

![Visual Studio Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rh2al75replnlfbb0f6i.png)

You can now proceed and start writing your code and installing your preferred extensions.

## Conclusion

In the above guide, you learned how to install Visual Studio Code on CentOS 8 desktop system. It is a very useful code editor for a developer that helps to develop any applications.

If you would like to host your application on the cloud server then I would recommend to try [Atlantic.net Cloud](https://www.atlantic.net/) and get started with one full year of free VPS hosting in the cloud!