How to run Visual Studio Code in Google Cloud Shell

Christiaan Hees
Jul 8, 2019 · 2 min read

Did you know you can run Visual Studio Code in a browser? It’s so cool, it even works with extensions and all that. I’ll show you an example using github.com/cdr/code-server

Image for post
Image for post
  • Enable Boost Mode to make it faster
Image for post
Image for post
  • Install code-server
export VERSION=`curl -s https://api.github.com/repos/cdr/code-server/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'`wget https://github.com/cdr/code-server/releases/download/$VERSION/code-server-$VERSION-linux-x86_64.tar.gztar -xvzf code-server-$VERSION-linux-x86_64.tar.gzcd code-server-$VERSION-linux-x86_64
  • Start the server
./code-server --no-auth --port 8080

Note that you don’t need authentication since the Google Cloud Shell proxy already handles that for you.

  • Click on Web Preview -> Preview on port 8080
Image for post
Image for post

If you get a 404, remove ?authuser=0 from the url. So for example, just
https://8080-dot-YOURID-dot-devshell.appspot.com/
instead of
https://8080-dot-YOURID-dot-devshell.appspot.com/?authuser=0

Image for post
Image for post

Google Cloud - Community

Google Cloud community articles and blogs

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store