How to run Visual Studio Code in Google Cloud Shell
Published in
Jul 8, 2019
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
- Go to console.cloud.google.com and open Cloud Shell
- Enable Boost Mode to make it faster
- Install code-server
curl -fsSL https://code-server.dev/install.sh | sh
- 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
If you get a 404, remove
?authuser=0
from the url. So for example, justhttps://8080-dot-YOURID-dot-devshell.appspot.com/
instead ofhttps://8080-dot-YOURID-dot-devshell.appspot.com/?authuser=0