How to set-up Code-Server to access directly from your browser?

ABHISHEK GUPTA
3 min readJun 21, 2020

Working on a project entirely remote on a browser is liberating. Virtual Studio (VS) Code, one of the best open-source code editors (managed by Microsoft) facilitates running it on a remote server directly through a browser. Here you will find, how?

Prerequisites:

1. You need to have wget

wget is used for downloading content from URLs. It’s a quick and simple non-interactive tool for downloading files from any publicly accessible URL.

wget takes a remote resource from a URL and saves it to a specified location on your computer

  • In case if you do not have a preinstalled wget, you will need to first install homebrew (missing package manager for macOS or Linux)which is pretty simple, just run the below command in the terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Next, you need to install wget with the following command:
brew install wget

2. Copy the latest code-server release link

Go to the code-server GitHub page and click in releases. From there you need to copy the link address for the latest version of code-server suitable for your OS.

Here is an example of my case.

Next

Once you have installed wget and copied the link, now is the time to open the terminal and download the code-server.

wget https://github.com/cdr/code-server/releases/download/3.4.1/code-server-3.4.1-macos-amd64.tar.gz

Next is to run the following command:

tar -xzvf code-server-3.4.1-macos-amd64.tar.gz 
code-server-3.4.1-macos-amd64/
code-server-3.4.1-macos-amd64/README.md
code-server-3.4.1-macos-amd64/LICENSE.txt
code-server-3.4.1-macos-amd64/code-server
code-server-3.4.1-macos-amd64/ThirdPartyNotices.txt

now if you check your current directory, you will be able to find the code-server-3.4.1-macos-amd64 folder.

ls

Next, you need to go to the folder where you can find the binary code-server file.

cd code-server-3.4.1-macos-amd64

Finally, we can run the code-server

./code-server

Note: you may get an error in this stage.

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.67.dylib
Referenced from: /Users/username/code-server-3.4.1-macos-amd64/lib/node
Reason: image not found
zsh: abort ./code-server

(this could be due to mismatch in package versions)

If so, you will need to run these commands,

brew update
brew upgrade
brew cleanup

In addition, some of you may need to run an additional command (I had to):

brew reinstall postgres

Besides this, in future, you may find the code-server file in bin folder. On that case, you will need to run,

./bin/code-server

Once you get success in running the code-server, you will get a port and password (you may get referred to ~/.config/code-server/config.yaml for password).

Copy the HTTP server.

You can also create your own password for the server (recommended):

username@Abhisheks-MBP code-server-3.4.1-macos-amd64 % PASSWORD=mypassword ./code-server

Code-Server will you for your password. Enter the one you set in the previous step and press Submit.

You’ll now enter code-server and immediately see its editor GUI on the browser.

Enjoy!!

--

--