DEV Community

Ionut aka BlitzCloud
Ionut aka BlitzCloud

Posted on • Updated on

VScode is now everywheređź’»

Table Of Contents:

What is code-server ?

I am sure that along your coding journey you heard at least one time about 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:

  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:

  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:

  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

Setup:

  1. Installation:
  • For linux and mac OS:
wget -O- https://aka.ms/install-vscode-server/setup.sh | sh
Enter fullscreen mode Exit fullscreen mode
  • For Windows(AMD64):
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")
Enter fullscreen mode Exit fullscreen mode
  • For Windows(ARM64):
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")
Enter fullscreen mode Exit fullscreen mode
  1. Run the code-server:
code-server
Enter fullscreen mode Exit fullscreen mode
  1. Continue the required setup.

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

code-server serve-local --host 0.0.0.0 --port 8080
Enter fullscreen mode Exit fullscreen mode

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 you can find the steps to set up a linux service.

Top comments (0)