DEV Community

Cover image for How To Run VS Code In Your Browser
Ben Matt, Jr.
Ben Matt, Jr.

Posted on

How To Run VS Code In Your Browser

If you like VS Code then you'll surely like this brand feature on VS Code!
Because yes! You can actually run VS Code on your browser!
And here is how!

First you need to check this repo : https://github.com/cdr/code-server

This is the official repo to get VS Code in your browser, once you get there you'll just need to copy & past those two command in your command prompt(You need to be administrator or sudo depending on what OS you're currently using).

First Copy & past this command: curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run

Now that you have code-server installed you need to copy & past this one: curl -fsSL https://code-server.dev/install.sh | sh

And after all that you're ready to go!
You just need to tape the following : code-server.

That will generate a log for you and you should search for this line right here: HTTP server listening on http://127.0.0.1:8080.

Copy & past that URL in your browser and see the magic!

This link will take you to a YouTube video that talks about it:
https://youtu.be/gB1Pg5ge06g

Top comments (12)

Collapse
 
unfor19 profile image
Meir Gabay

I love code-server! You can also run it without installing anything by using Docker, it's in the docs

# This will start a code-server container and expose it at http://127.0.0.1:8080.
# It will also mount your current directory into the container as `/home/coder/project`
# and forward your UID/GID so that all file system operations occur as your user outside
# the container.
#
# Your $HOME/.config is mounted at $HOME/.config within the container to ensure you can
# easily access/modify your code-server config in $HOME/.config/code-server/config.json
# outside the container.
mkdir -p ~/.config
docker run -it -p 127.0.0.1:8080:8080 \
  -v "$HOME/.config:/home/coder/.config" \
  -v "$PWD:/home/coder/project" \
  -u "$(id -u):$(id -g)" \
  codercom/code-server:latest
Collapse
 
jrmatanda profile image
Ben Matt, Jr.

Yes of course you can! So enjoy it!

Collapse
 
warengonzaga profile image
Waren Gonzaga

You can now literally code on the cloud via GitHub Codespaces!
dev.to/warengonzaga/github-codespa...

Collapse
 
jrmatanda profile image
Ben Matt, Jr.

Thanks I appreciate it, I've already subscribed for the beta version but I'm still waiting 😋

Collapse
 
warengonzaga profile image
Waren Gonzaga

You'll love it promise!

Collapse
 
michaelphipps profile image
Phippsy

That is cool! Is updating as new versions get released easy?

Collapse
 
jrmatanda profile image
Ben Matt, Jr.

Yes of course! Just try it 🤓

Collapse
 
michaelphipps profile image
Phippsy

So the answer is NO, you can't update VS Code as versions are released. You can update Code-OSS as versions are released, but it is behind the current version.

Additionally, the list of extensions is not complete. In particular, the remote ssh extension which I use ALL the time is not available due to licensing issues. I tried installing it manually, which I could easily do, but it doesn't work.

APART FROM THAT. It's fucking awesome. Just not something I will be able use for my day to day development tasks currently.

Collapse
 
alibasiccoder profile image
AliBasicCoder

really helpful

Collapse
 
jrmatanda profile image
Ben Matt, Jr.

Happy to hear that 🤓

Collapse
 
luscala profile image
Luca Scala

What about the hotkeys? I tried this approach in the past, but this was a blocking-issue...

Some comments may only be visible to logged-in visitors. Sign in to view all comments.