Install
- install.sh
- npm
- Standalone releases
- Debian, Ubuntu
- Fedora, CentOS, RHEL, SUSE
- Arch Linux
- Artix Linux
- macOS
- Docker
- Helm
- Windows
- Raspberry Pi
- Termux
- Cloud providers
- Uninstall
This document demonstrates how to installcode-server
on various distros andoperating systems.
install.sh
The easiest way to install code-server is to use ourinstallscript for Linux, macOS and FreeBSD. The install scriptattempts to use the system package manager if possible.
You can preview what occurs during the install process:
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
To install, run:
curl -fsSL https://code-server.dev/install.sh | sh
You can modify the installation process by including one or more of thefollowing flags:
--dry-run
: echo the commands for the install process without running them.--method
: choose the installation method.--method=detect
: detect the package manager but fallback to--method=standalone
.--method=standalone
: install a standalone release archive into~/.local
.
--prefix=/usr/local
: install a standalone release archive system-wide.--version=X.X.X
: install versionX.X.X
instead of latest version.--help
: see usage docs.--edge
: install the latest edge version (i.e. pre-release)
When done, the install script prints out instructions for running and startingcode-server.
If you're concerned about the install script's use of
curl | sh
and thesecurity implications, please seethis blogpostbysandstorm.io.
If you prefer to install code-server manually, despite thedetectionreferences and--dry-run
feature, then continue on forinformation on how to do this. Theinstall.sh
script runs theexact same commands presented in the rest of this document.
Detection reference
For Debian and Ubuntu, code-server will install the latest deb package.
For Fedora, CentOS, RHEL and openSUSE, code-server will install the latest RPMpackage.
For Arch Linux, code-server will install the AUR package.
For any unrecognized Linux operating system, code-server will install thelatest standalone release into
~/.local
.- Ensure that you add
~/.local/bin
to your$PATH
to run code-server.
- Ensure that you add
For macOS, code-server will install the Homebrew package (if you don't haveHomebrew installed, code-server will install the latest standalone releaseinto
~/.local
).- Ensure that you add
~/.local/bin
to your$PATH
to run code-server.
- Ensure that you add
For FreeBSD, code-server will install thenpm package with
npm
If you're installing code-server onto architecture with no releases,code-server will install thenpm package with
npm
- We currently offer releases for amd64 and arm64.
- Thenpm package builds the native modules on post-install.
npm
We recommend installing withnpm
when:
- You aren't using a machine with
amd64
orarm64
. - You are installing code-server on Windows.
- You're on Linux with
glibc
< v2.28 orglibcxx
< v3.4.21. - You're running Alpine Linux or are using a non-glibc libc. See#1430for more information.
Installing code-server withnpm
builds native modules on install.
This process requires C dependencies; see our guide oninstalling with npm for more information.
Standalone releases
We publish self-contained.tar.gz
archives for every release onGitHub. The archives bundle thenode binary and node modules.
We create the standalone releases using thenpm package, and wethen create the remaining releases using the standalone version.
The only requirement to use the standalone release isglibc
>= 2.28 andglibcxx
>= v3.4.21 on Linux (for macOS, there is no minimum systemrequirement).
To use a standalone release:
- Download the latest release archive for your system fromGitHub.
- Unpack the release.
- Run code-server by executing
./bin/code-server
.
You can add./bin/code-server
to your$PATH
so that you can executecode-server
without providing full path each time.
Here is a sample script for installing and using a standalone code-serverrelease on Linux:
mkdir -p ~/.local/lib ~/.local/bincurl -fL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-linux-amd64.tar.gz \ | tar -C ~/.local/lib -xzmv ~/.local/lib/code-server-$VERSION-linux-amd64 ~/.local/lib/code-server-$VERSIONln -s ~/.local/lib/code-server-$VERSION/bin/code-server ~/.local/bin/code-serverPATH="~/.local/bin:$PATH"code-server# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
Debian, Ubuntu
The standalone arm64 .deb does not support Ubuntu 16.04 or earlier. Pleaseupgrade orbuild with npm.
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server_${VERSION}_amd64.debsudo dpkg -i code-server_${VERSION}_amd64.debsudo systemctl enable --now code-server@$USER# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
Fedora, CentOS, RHEL, SUSE
The standalone arm64 .rpm does not support CentOS 7. Please upgrade orbuildwith npm.
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpmsudo rpm -i code-server-$VERSION-amd64.rpmsudo systemctl enable --now code-server@$USER# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
Arch Linux
# Install code-server from the AUR using yay.yay -S code-serversudo systemctl enable --now code-server@$USER# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Install code-server from the AUR with plain makepkg.git clone https://aur.archlinux.org/code-server.gitcd code-servermakepkg -sisudo systemctl enable --now code-server@$USER# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
Artix Linux
# Install code-server from the AURgit clone https://aur.archlinux.org/code-server.gitcd code-servermakepkg -si
Save the file ascode-server
in/etc/init.d/
and make it executable withchmod +x code-server
. Put your username in line 3.
#!/sbin/openrc-runname=$RC_SVCNAMEdescription="$name - VS Code on a remote server"user="" # your username herehomedir="/home/$user"command="$(which code-server)"# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry"command_user="$user:$user"pidfile="/run/$name/$name.pid"command_background="yes"extra_commands="report"depend() { use logger dns need net}start_pre() { checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name}start() { default_start report}stop() { default_stop}status() { default_status report}report() { # Report to the user einfo "Reading configuration from ~/.config/code-server/config.yaml"}
Start on boot with default runlevel
rc-update add code-server default
Start the service immediately
rc-service code-server start
macOS
brew install code-serverbrew services start code-server# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
Docker
# This will start a code-server container and expose it at http://127.0.0.1:8080.# It will also mount your current directory into the container as `/home/coder/project`# and forward your UID/GID so that all file system operations occur as your user outside# the container.## Your $HOME/.config is mounted at $HOME/.config within the container to ensure you can# easily access/modify your code-server config in $HOME/.config/code-server/config.json# outside the container.mkdir -p ~/.configdocker run -it --name code-server -p 127.0.0.1:8080:8080 \ -v "$HOME/.local:/home/coder/.local" \ -v "$HOME/.config:/home/coder/.config" \ -v "$PWD:/home/coder/project" \ -u "$(id -u):$(id -g)" \ -e "DOCKER_USER=$USER" \ codercom/code-server:latest
Our official image supportsamd64
andarm64
. Forarm32
support, you canuse acommunity-maintained code-serveralternative.
Helm
You can install code-server using theHelm package manager.
Windows
We currentlydo not publish Windowsreleases. We recommendinstalling code-server onto Windows withnpm
.
Raspberry Pi
We recommend installing code-server onto Raspberry Pi withnpm
.
If you see an error related tonode-gyp
during installation, See#5174 for more information.
Termux
Please see code-server'sTermux docs for moreinformation.
Cloud providers
We maintainone-click apps and install scripts for cloudproviders such as DigitalOcean,Railway, Heroku, and Azure.
Uninstall
code-server can be completely uninstalled by removing the application directory, and your user configuration directory.
To delete settings and data:
rm -rf ~/.local/share/code-server ~/.config/code-server
install.sh
If you installed with the install script, by default code-server will be in~/.local/lib/code-server-<version>
and you can remove it withrm -rf
. e.g.
rm -rf ~/.local/lib/code-server-*
Homebrew
To remove the code-server homebrew package, run:
brew remove code-server# Alternativelybrew uninstall code-server
npm
To remove the code-server global module, run:
npm uninstall --global code-server
Debian, Ubuntu
To uninstall, run:
sudo apt remove code-server