VScode is now everywhere💻
Tags: tutorial, vscode
Published: 2022-09-26 16:25:07

## Table Of Contents:

- [What is code-server](#what-is)
- [Use cases](#use)
- [Advantages](#adv)
- [Disavantages](#dis)
- [Setup](#setup)
- [Summery](#sum)

### What is code-server ? <a name="what-is"></a>

I am sure that along your coding journey you heard at least one time about [code-server](https://github.com/coder/code-server) witch it is great, but today I am gonna show an alternative solution to that that comes with a secure tunneling service, to eliminate the need of opened ports on the server side. Beside the web interface code-server allow  you to connect your local instance of VScode to the remote environment. During the installation your GitHub account will be associated to the secure tunneling service this way only you can access that instance. The code-server can be run that its accessible only from the local network too.

### Use cases: <a name="use"></a>

1. Behind a firewall where you don't want to change the rules.
2. When ssh connections aren't allowed.
3. For students like me.

### Advantages: <a name="adv"></a>

1. Hight security
2. Support for all VSCode extensions
3. Official support from Microsoft
4. Easy to deploy and access from remote locations
5. Support for AMD64 and ARM64.

### Disadvantages: <a name="dis"></a>

1. The code-server source-code it's not opened source.
2. The service it is in a private preview and require to go throw a [signup form](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR2RUg5vzJXJDmTEUlArnJpdUNDEyNkJCQU1LUjgyVFpWRk9GM09SWDlETy4u)

### Setup: <a name="setup"></a>

1. Installation:

- For linux and mac OS:

```sh
wget -O- https://aka.ms/install-vscode-server/setup.sh | sh
```

- For Windows(AMD64):

```powershell
New-Item "$HOME\.vscode-server-launcher\bin" -ItemType "directory" -Force
Invoke-WebRequest "https://aka.ms/vscode-server-launcher/x86_64-pc-windows-msvc" -OutFile "$HOME\.vscode-server-launcher\bin\code-server.exe"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$HOME\.vscode-server-launcher\bin", "User")
```

- For Windows(ARM64):

```powershell
New-Item "$HOME\.vscode-server-launcher\bin" -ItemType "directory" -Force
Invoke-WebRequest "https://aka.ms/vscode-server-launcher/aarch64-pc-windows-msvc" -OutFile "$HOME\.vscode-server-launcher\bin\code-server.exe"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$HOME\.vscode-server-launcher\bin", "User")
```

2. Run the code-server:

```sh
code-server
```

3. Continue the required setup.

4. Alternative you can run it just for the local network with:

```sh
code-server serve-local --host 0.0.0.0 --port 8080
```

### Summery:

Code-Server it's great service for those of you that are familiar with the VSCode and want to have access to their tools and extensions. It's a nice to have service on your development machine with out exposing you to any unnecessary risks, but lacks a service to run it on the start up or in background and its use cases are narrow.
##### For those of you that want to take this a step forward [here](https://dev.to/blitz_cloud/now-you-can-run-a-code-server-as-a-service-in6) you can find the steps to set up a linux service.