This project provides a version of VS Code that runs as a server on a remote machine, accessible through a modern web browser. It utilizes the same architecture used by RunCode to deliver scalable remote development environments.
VS Code was originally developed as a desktop IDE using web technologies. As remote development gained popularity, the community began adapting it for remote access via web browsers. However, these adaptations were often complex and error-prone due to the extensive changes required across VS Code's large codebase.
In 2019, the VS Code team began restructuring its architecture to natively support a browser-based environment. While platforms like Gitpod and GitHub adopted this architecture, the key components remained closed-source until recently. Consequently, many developers continued to use the older, more difficult methods.
At RunCode, we've frequently been asked about our approach. To support the community, we're sharing the minimal set of changes required to utilize the latest version of VS Code, ensuring easier upgrades and reduced maintenance.
- Start the server:
docker run -it --init -p 8000:8000 -v "$(pwd):/home/runcode/workspace:cached" runcode/runcode-server
- Visit the URL printed in your terminal.
- For additional possibilities, please consult the
Dockerfile
for OpenVSCode Web Server at https://github.com/runcode-io/runcode-releases/
-
Untar and run the server
unzip openvscode-web-server-v${OPENVSCODE_SERVER_VERSION}.zip cd vscode-reh-web-linux-x64 ./bin/runcode-server # you can add arguments here, use --help to list all of the possible options
From the possible entrypoint arguments, the most notable ones are
--port
- the port number to start the server on, this is 8000 by default--without-connection-token
- used by default in the docker image--connection-token
&--connection-token-file
for securing access to the IDE, you can read more about it in Securing access to your IDE.--host
- determines the host the server is listening on. It defaults tolocalhost
, so for accessing remotely it's a good idea to add--host 0.0.0.0
to your launch arguments.
-
Visit the URL printed in your terminal.
You can access the Web UI without authentication (anyone can access the IDE using just the hostname and port), if you need some kind of basic authentication then you can start the server with --connection-token YOUR_TOKEN
, the provided YOUR_TOKEN
will be used and the authenticated URL will be displayed in your terminal once you start the server. You can also create a plaintext file with the desired token as its contents and provide it to the server with --connection-token-file YOUR_SECRET_TOKEN_FILE
.
If you want to use a connection token and are working with OpenVSCode Web Server via the Docker image, you will have to edit the ENTRYPOINT
in the Dockerfile or modify it with the entrypoint
option when working with docker-compose
.
This project only adds minimal bits required to run VS Code in a server scenario. We have no intention of changing VS Code in any way or to add additional features to VS Code itself. Please report feature requests, bug fixes, etc. in the upstream repository.
For any feature requests, bug reports, or contributions that are not specific to running VS Code in a server context, please go to Visual Studio Code - Open Source "OSS"
VS Code includes a set of built-in extensions located in the extensions folder, including grammars and snippets for many languages. Extensions that provide rich language support (code completion, Go to Definition) for a language have the suffix language-features
. For example, the json
extension provides coloring for JSON
and the json-language-features
extension provides rich language support for JSON
.
This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.
- For Dev Containers, use the Dev Containers: Clone Repository in Container Volume... command which creates a Docker volume for better disk I/O on macOS and Windows.
- If you already have VS Code and Docker installed, you can also click here to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
- For Codespaces, install the GitHub Codespaces extension in VS Code, and use the Codespaces: Create New Codespace command.
Docker / the Codespace should have at least 4 Cores and 6 GB of RAM (8 GB recommended) to run full build. See the development container README for more information.
This project is not affiliated with Microsoft Corporation.