Run VSCode remotely with Coder

This is a very easy way to write code on VSCode in your browser hosted on a remote server.

Michael Rhema
Another DIY Javascript Experiment
3 min readMay 10, 2019

--

Installing Coder on Azure VM

code-server is VS Code running on a remote server, accessible through the browser. You can read more about it on the coder website or github page. 3 things make me want to try out coder-

  • Code on your Chromebook, tablet, and laptop with a consistent dev environment.
  • Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
  • Cloud9 my favorite web IDE is closing down on June 30.

To install Coder on a remote server, you need to have install Docker on your Azure VM / remote server. I’ll be running on an Azure Virtual Machine with Ubuntu 18.04 installed.

my VM — 4gb 2cpus VM running on Ubuntu 18.04 server

For this setup, I had to ensure port 8443 is open. To configure my VM firewall, I selected Networking -> Add Inbound Port.

I already have Docker installed so I tried out the command from the Coder github README page. docker run -it -p 127.0.0.1:8443:8443 -v “${PWD}:/home/coder/project” codercom/code-server — allow-http — no-auth .

Every thing seems to be running fine.

The container started up and ran with no errors. However, I could not visit my-ip:8443 to see Coder come up just yet. I had to run the command with a few tweaks.

docker run -d -p 0.0.0.0:8443:8443 -v “${PWD}:/home/coder/project” codercom/code-server — allow-http — no-auth -d “/home/coder/project/userdata”

If you need to know about docker run hit here. I changed the binding network address from 127.0.0.1 to 0.0.0.0 which means all network interfaces. I also added a user directory so I can possibly retain my configuration and settings using the -d argument. You can read about it from Coder docs. After running that command, I got to VSCode in my Browser by visiting my-ip:8443.

Thanks Coder ✨ 👏
I will be trying out installing plugins, opening work-spaces, accessing CLI and other coding workflow and I’ll update this post with my experience. This should be fun 😆.

UPDATE 🌟

I found out the stock Docker image for Coder does not contain PHP and Python. There’s also this bug with the integrated terminal not working properly. I have created another version of the Dockerfile here. You an also use the Docker image I built here. I have plans to add NVM and other cool stuff to this image. Don’t forget to ⭐️ the repo. I’ll appreciate it.

👏Please clap. Please share this post. 👏

I appreciate claps if you ❤️ this post. Stay with me for Another DIY Javascript Experiment and dope coding topics including Machine Learning, React ecosystem, Linux and anything Javascript does.

--

--

Michael Rhema
Another DIY Javascript Experiment

Like those before me, I think therefore I am. These are my Javascript, Tech & Personal development notes. tohju.com