Is it possible to run VSCode on a remote server and access it via a browser? What are the benefits/drawbacks to running a Web IDE this way? What kind of server specs do I need? What are the steps to setting it up? How do I make sure the server is secure?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hello,
Thanks for the great question!
Yes this is definitely possible thanks to a company called Coder. They recently open sourced a project called Coder Server. It basically allows you to run VScode on a remote server and access it via your browser.
Benefits:
This allows you access your IDE from any machine (even your phone if you needed to)
You could have multiple people working on the same project from the same editor
And of course if you run it on DigitalOcean you could easily add more resources to the server that you are running the VScode on at any time
Even though you would be working from your browser it actually feels just as you were to work on your desktop
Drawbacks:
I’ve noticed that when saving files there’s some delay as the files have to actually be saved on the remote server, though to be honest when writing code you can’t notice the lag
You would have to pay for the resources that you use, though again if the laptop that you use is not very powerful it would be quite handy for you. For example I have an old MacBook Air with only 4GB of RAM so running my IDE on a DigitalOcean server saves me a lot of local resources
Another downside is that you would always need internet access to be able to work on your project
Server Specs:
As far as I know it is recommended to start with at least 2 CPUs and 7-8GB of Memory
I’ve tested it on Ubuntu but it should work on any other major Linux Distributions
Installation and Configuration:
Before you start you would need to create a droplet via the DigitalOcean control panel with the recommended 2 CPUs and 8GB of RAM. Then you would have to SSH to the droplet. If you are not sure how to do that you could follow the step here:
https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/putty/
Once you’ve created and accessed your VM, you need to get a copy of the latest release of Code Server and deploy it on the droplet.
https://github.com/codercom/code-server/releases/latest
wget
command:wget https://github.com/cdr/code-server/releases/download/1.1156-vsc1.33.1/code-server1.1156-vsc1.33.1-linux-x64.tar.gz
Note: Change the URL with the latest Code server release to make sure that you are running the latest version!
tar -xvzf code-server1.1156-vsc1.33.1-linux-x64.tar.gz
cd code-server1.1156-vsc1.33.1-linux-x64
chmod u+x code-server
./code-server -p 80
As by default code server uses a self signed SSL, you would get an SSL warning in your browser that you could accept and ignore.
That is pretty much it, now you would have your IDE running on DigitalOcean and it would work and feel just like the on your desktop!
docker run -it -p 8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth
Security
What I would suggest is the following:
https://github.com/cdr/code-server/blob/master/doc/security/code-server.fail2ban.conf
And
https://github.com/cdr/code-server/blob/master/doc/security/fail2ban.md
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.