![]() |
VOOZH | about |
The author selected the Free and Open Source Fund to receive a donation as part of the Write for DOnations program.
With developer tools moving to the cloud, creation and adoption of cloud IDE (Integrated Development Environment) platforms is growing. Cloud IDEs allow for real-time collaboration between developer teams to work in a unified development environment that minimizes incompatibilities and enhances productivity. Accessible through web browsers, cloud IDEs are available from every type of modern device.
code-server is Microsoft Visual Studio Code running on a remote server and accessible directly from your browser. Visual Studio Code is a modern code editor with integrated Git support, a code debugger, smart autocompletion, and customizable and extensible features. This means that you can use various devices running different operating systems, and always have a consistent development environment on hand.
In this tutorial, you will set up the code-server cloud IDE platform on your Ubuntu 20.04 machine and expose it at your domain, secured with free Let’s Encrypt TLS certificates. In the end, you’ll have Microsoft Visual Studio Code running on your Ubuntu 20.04 server, available at your domain and protected with a password.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
Expert in cloud topics including Kafka, Kubernetes, and Ubuntu.
Former Senior Technical Editor at DigitalOcean, with a strong focus on DevOps and System Administration content. Areas of expertise include Terraform, PyTorch, Python, and Django.
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!
Hello. All was good until Step 2 — Exposing code-server at Your Domain
It just does not work on my side.
What did I setup on Namecheap.com (my registrar)? I created one “A Record”, for host @ pointing to my DO VPS IP address. So far my “index.html” is displayed as expected.
Then I did the setup suggested in Step #2, for nginx and the code-server.mydomain.com.
Chrome: This site can’t be reached code-server.mydomain.com’s server IP address could not be found. Try running Windows Network Diagnostics. DNS_PROBE_FINISHED_NXDOMAIN
Firefox: *Hmm. We’re having trouble finding that site.
We can’t connect to the server at code-server.palazuelos.xyz.
If that address is correct, here are three other things you can try:
Try again later.
Check your network connection.
If you are connected but behind a firewall, check that Firefox has permission to access the Web*
Any idea or suggestion? thanks,
Fantastic documentation! Every step went exactly as you said it would and everything worked flawlessly. Thanks for the terrific work!
I got this all up and running, thanks for the instructions! However, whenever I run the terminal within code-server, I get ‘Command not found’ errors. It doesn’t seem to be able to find anything like nvm, npm, or yarn that all work when using the terminal directly on the box.
Any idea where I went wrong there or how to fix?
Thank you for the documentation. I have followed the steps and getting the error "WebSocket close with status code 1006" when I open the code server in the browser. Do you know what can be the issue?
Kind regards, Aykut
Hi,
What you are doing:
sudo systemctl enable code-server
is wrong because it will start code-server as root which is dangerous! You can see this if you open the integrated terminal where it says “root@”.
Instead you should enable the service on start-up like this:
sudo systemctl enable --now code-server@$USER
then:
sudo service code-server start
The code server works fine for me if I use it through SSH tunnel. However, once I configure nginx, it gets stuck on the login page itself. If I enter the password, it just refreshes on the same page.
Can anyone help me resolve this issue? I am using code-server 3.10.0
This comment has been deleted
Any tricks on how to avoid that it keeps directing to root? Everything else works.
Thanks
Hi,
Thank you for the clear detailed documentation. Its excellent. I followed all the steps properly and its working.!
I need an help in one thing, I have few teams working on different projects, Can I restrict the developers/users to open only the assigned projects to them in code-server? If yes, can I know how?
I also need to restrict the developers/users only to their project specific files and project specific command lines.
It would help me a lot! If I get a solution.
Thanks in advance.
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.