Registry / devops / code-server

code-server

JSON →
library4.116.0jsnpmunverified

code-server enables running Microsoft's Visual Studio Code on a remote server, accessible via a web browser. This facilitates a consistent development environment across various devices, leveraging cloud server resources for computationally intensive tasks like compilation, testing, and downloads, thereby preserving local device battery life. The current stable version is 4.116.0, which updates to VS Code 1.116.0. The project maintains a frequent release cadence, generally updating monthly to align with new VS Code versions. Key differentiators include its ability to centralize development environments, utilize server-side processing power, and offer a web-based IDE experience without direct client-side VS Code installation. It requires a Linux machine with WebSockets enabled, at least 1GB RAM, and 2 vCPUs, and is built for Node.js 22.

npm install code-server
INSTALL
IMPORT
SIG · CODE-SERVER
C
code-server
devopsjavascriptv4.116.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to install `code-server` using its recommended `install.sh` script and provides basic command-line examples for running the server, setting authentication, binding to an address, and specifying a project directory.

# Install code-server using the official script curl -fsSL https://code-server.dev/install.sh | sh # The install script will print instructions for running code-server. # A common way to run it is: # code-server --auth password # # For unattended or background operation, you might use nohup or tmux: # nohup code-server --auth password --bind-addr 0.0.0.0:8080 & # # Replace 'yourpassword' with a strong password. # Access it in your browser at the specified address (e.g., http://your-server-ip:8080) # # To specify a specific workspace or folder: # code-server --auth password --bind-addr 0.0.0.0:8080 /path/to/your/project
code-server --version
Debug
Known issues
breakingcode-server strictly adheres to a specific Node.js major version, currently Node.js 22. Running with an unsupported Node.js version can lead to startup failures or unexpected behavior.
fix
Ensure your system's Node.js version matches the `engines.node` requirement (currently 22). Use a Node Version Manager (e.g., nvm) to easily switch versions: `nvm install 22 && nvm use 22`.
affects: >=4.113.0
breakingcode-server v4.113.1 fixed an issue where `arm64` and `armv7l` architectures were packaging `amd64` Node binaries due to a CI refactoring mistake in v4.113.0. Users on ARM-based systems might experience startup failures or incorrect architecture detection with v4.113.0.
fix
Upgrade immediately to `code-server v4.113.1` or newer if running on `arm64` or `armv7l` architectures.
affects: =4.113.0
gotchaThe required `glibc` version was temporarily raised, potentially causing issues on older Linux distributions. Version v4.114.1 reverted this, bringing the requirement back down to 2.28.
fix
If encountering `glibc` related errors on older Linux systems, upgrade to `code-server v4.114.1` or a newer version to benefit from the reduced `glibc` requirement (2.28).
affects: >4.113.1 <4.114.1
gotchaThe `--trusted-origins` configuration now supports wildcard `*.` at the beginning of a domain, allowing `*.example.com` to match both `example.com` and `sub.example.com`. Older configurations expecting only exact matches might need adjustment for broader access or stricter security.
fix
Review your `--trusted-origins` configuration. If you intend to allow subdomains, use `*.domain.com`. If strict matching is desired, ensure no `*` is present and list each origin explicitly.
affects: >=4.113.0
gotchaThe `--reconnection-grace-time` flag was added in v4.113.0, controlling how many seconds clients have to reconnect before a session is permanently killed. This changes default session persistence behavior, which might impact long-running browser sessions or intermittent network connections.
fix
If you experience sessions being terminated too quickly after a disconnection, configure `--reconnection-grace-time` with a higher value (in seconds) suitable for your network conditions, e.g., `code-server --reconnection-grace-time 300`.
affects: >=4.113.0
Errors
Common errors & fixes
Error: The Node.js version is too old. Expected 22. Found X.Y.Z
`code-server` requires a specific Node.js major version (currently 22) as indicated by its `engines.node` requirement.
fix
Install and use the required Node.js version. If using nvm, run `nvm install 22 && nvm use 22`. Otherwise, ensure your system's default `node` executable is version 22.
code-server: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
Your Linux distribution's `glibc` version is older than what `code-server` requires, leading to missing shared libraries.
fix
Upgrade `code-server` to v4.114.1 or newer, which explicitly lowered the `glibc` requirement to 2.28. If the issue persists, consider upgrading your OS or running `code-server` in a more modern environment like a Docker container.
WebSocket connection to 'ws://...' failed: Error during WebSocket handshake: Unexpected response code: 400
This typically indicates an issue with `code-server`'s startup arguments, firewall rules, or reverse proxy configuration preventing a successful WebSocket connection.
fix
Ensure `code-server` is running with the correct `--bind-addr` (e.g., `0.0.0.0:8080` for external access), check server firewall rules, and verify your `--trusted-origins` setting if accessing via a custom domain or reverse proxy.
Session has been permanently killed. Please reload the window.
The client lost connection to `code-server` for longer than the configured (`--reconnection-grace-time`) or default grace period, causing the server to terminate the session.
fix
Increase the `--reconnection-grace-time` value when starting `code-server` to allow for longer disconnections, for example: `code-server --reconnection-grace-time 300` (for 5 minutes).
Upgrade
Version history
4.116.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
code-server — npm install code-server · libregistry