Along with the widely cloud adoption, integrated development environment (IDE) on browser is a need to boot developers’ productivity. People can collaboratively view, edit and commit on any devices with internet accessed browser. Additionally, you’re no longer worry about setting up your local development config. You can consider Cloud9 (AWS) or paid service like codeanywhere.
However, if you are familiar to Visual Code Studio, you wish to have a similar web-based IDE to work on a project from your VM instance and you love open source software (OSS), code-server (with the core of VSCode) is perfectly for you. This project is recently opened sourced by coder.com, we all appreciated that.
Although original VS Code actually supports ssh extension, there is still such pain of network lagging and proxy policies per my current work. Code-server is a better way to go.
After experienced number tutorials, I come up with my owned way which will help to get the code-server up and running as daemon service in about 5 minutes. It is tested on CentOS 7 and Ubuntu 18.04, other Linux distro should be similar.
Depending on targeted OS and code-server version, you can modify the suffix or get the released download link direct from here.
In this post, I use version 2.1692-vsc1.39.2 for linux-x86_64. Download and extract the gz file, then copy binary file code-server to executable files location
/bin/. Remove unnecessary files and folder.
Prepare log store location when running code-server in
/var/log/ by creating folder and empty files in advanced. Create code-server.service under systemd to make it as a service running in the background.
mkdir -p /var/log/code-server/
Here is the content of code-server.service, remember the PASSWORD variable to login when code-server is up. As default, it will use port 8080.
One more step to start code-server as a background service and auto start once system reboots.
sudo systemctl daemon-reload
If code-server status is active then you are good to go. Enable inbound (aka. ingress) traffic for port 8080, and access your IDE with defined PASSWORD previously.
To bring code-server to a new level of cloud IDE for a team, it would be ideal tool if equipped with 2 more features:
- Security plugin for authentication and authentization management
- Team collaborative features like google docs or office365