code-server brings Visual Studio Code to your browser. The editor runs on your server, and you open it on any device with a browser to get the familiar interface with a file tree, Git view, extensions, and terminal. Your code, tools, and computing power stay on the server. In this guide, we’ll show you two ways to set it up: the easy way as a One-Click App, which makes code-server available with HTTPS and a password in just a few clicks, and a manual installation with Docker Compose. After that, you’ll fetch a project with Git, install extensions, and set up languages such as Python.
A browser-based editor of your own is useful when:
- You want to program from different devices, such as a tablet, a borrowed PC, or a Chromebook where you can’t or aren’t allowed to install anything.
- You want your projects and tools in one place: Open your browser and pick up right where you left off, no matter which device you’re using.
- You want to use less powerful devices: Builds, dependencies, and tests run on the VPS, not your laptop.
- You want to edit scripts, bots, or configurations directly on the server, with syntax highlighting and a terminal instead of using
nanoover SSH.
code-server is less suitable if you already work on your own computer with VS Code installed. In that case, Microsoft’s Remote - SSH extension is often the better choice (see the next section). code-server is also not designed for multiple people: there is exactly one password and no user management.
Both options let you edit code on the server. The difference is what you need on your device and which extensions are available:
| code-server | VS Code with Remote-SSH | |
|---|---|---|
| On your device | just a browser | installed VS Code and SSH access |
| Tablet, borrowed PC | yes | no |
| Extensions | from the open Open VSX gallery | from the Microsoft Marketplace |
| Live Share, Pylance, Remote extensions | not available | available |
| Keyboard shortcuts | some are captured by the browser | work as usual |
| Login | password in the browser | SSH key |
The reason for using a different gallery: according to the code-server FAQ, the Microsoft Marketplace terms of use allow extensions only in Microsoft products. code-server therefore uses Open VSX. Many well-known extensions are available there too, but closed-source Microsoft extensions such as Live Share, Pylance, and the Remote extensions are not.
The quickest way to get started with code-server is through your VPS’s One-Click Apps. With a domain, the app is available directly over HTTPS and is protected by a randomly generated password at startup. You don’t need a reverse proxy or certificate.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
- Enough resources: the app catalog lists at least 1 CPU core, 1 GB RAM, and 3 GB of storage; 2 cores, 2 GB RAM, and 20 GB are recommended. Extensions such as language servers and your own builds can quickly require more memory.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search the app catalog for Code Server and click Install app.
- Use a custom subdomain or zap.cloud is already selected, with a randomly generated name. Leave it enabled or enter your own name. Without a domain, the editor and password login would only be accessible over HTTP.
- You don’t need to fill in anything under App configuration. The app generates two values automatically:
SERVICE_PASSWORD_64_PASSWORDCODESERVERfor login andSERVICE_PASSWORD_SUDOCODESERVERforsudoin the terminal. - Click Queue installation. After about a minute, code-server will appear online on the app card.
The app card will already tell you that the password was generated during installation. You can find it in the app settings (gear icon), under App environment > Automatically generated values, as SERVICE_PASSWORD_64_PASSWORDCODESERVER. It’s 64 characters long, so it’s best to copy it.
- Open the app’s Access link.
- The Welcome to code-server page appears, with a note that the password comes from
$PASSWORD. Enter the password and click Submit. - code-server opens the working directory
/config/workspacedirectly.
According to the documentation, code-server allows only two login attempts per minute and twelve more per hour. There is no username, just this one password. Save it in a password manager and don’t share it.
Anyone with the password has terminal access to your server code-server includes a full-featured terminal. Anyone who logs in can run commands and install programs with the sudo password. Treat the login password like SSH credentials.
The first time you open code-server, you’ll see Restricted Mode at the top. This protects you from unfamiliar files that could run code when opened. When you open the terminal for the first time, code-server asks Do you trust the authors of the files in this folder? For your own projects, click Trust Folder & Continue.
Anything you want to keep is stored in the Docker volume under /config: your working directory /config/workspace, settings, installed extensions, and SSH keys in /config/.ssh. This content is preserved through restarts and updates.
The terminal doesn’t run directly on your VPS, but inside the app’s container. In our test, it showed Ubuntu 24.04 and ran as the abc user (UID 1000) without root privileges. With sudo and the second generated password, SERVICE_PASSWORD_SUDOCODESERVER, you become root inside the container. This does not give you access to your VPS itself, other apps, or Docker because the Docker socket isn’t mounted.
The container comes with git, curl, and sudo, among other tools. Python, Node.js, and other languages are not included, but you can install them later (see below).
Update code-server in the app settings (gear icon), under App update. Click Check for updates, then install a new version with Apply update. If the page says the app is up to date, no newer version is available in the app catalog yet. The app uses the linuxserver.io image with code-server 4.145.2. If the editor itself shows a newer version at the bottom right, that indicates the latest project version. You can install it only after it becomes available in the app catalog.
Reinstall packages added after an update
An update recreates the container. Everything under /config is preserved, but packages you installed with apt will be gone. Keep a short list or a script in your working directory to track them.
A volume is not a backup. It’s best to keep your projects in a Git repository on another server, such as GitHub or your own Forgejo. To make a copy of the entire volume, use SSH on your VPS to archive it:
C=$(docker ps --format '{{.Names}}' | grep '^code-server-')
docker exec $C tar -czf /tmp/code-server-backup.tar.gz -C /config workspace data extensions .ssh
docker cp $C:/tmp/code-server-backup.tar.gz .
Then copy the file to your computer over SFTP. The archive also contains your SSH keys, so store it securely.
The rest of this guide describes a manual installation of code-server with Docker Compose. We’ll use the same image from linuxserver.io as the One-Click App. The instructions on reverse proxies and extensions are from the official code-server documentation.
- A Linux VPS running Debian or Ubuntu, with SSH access. See First SSH Access.
- Docker and Docker Compose. See Install Docker. Verify the installation with
docker --versionanddocker compose version. - For HTTPS: a domain or subdomain whose A record points to your VPS’s IP address (e.g.,
code.example.com).
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 core | 2 cores |
| RAM | 1 GB | 2 GB or more |
| Storage | 3 GB | 20 GB or more |
The official documentation recommends at least 1 GB RAM and 2 CPU cores. Language servers, dependencies, and project builds will increase resource requirements.
code-server listens on port 8443 inside the container. Don’t expose the port externally; access is handled through the reverse proxy. With ufw, allow only SSH, HTTP, and HTTPS:
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Docker bypasses ufw
Ports published by Docker using ports: are accessible externally even if ufw blocks them. So, as shown in the Compose file below, bind code-server only to 127.0.0.1. For more information about the firewall, see Manage the Firewall on Linux.
Create a directory and generate two random passwords in a .env file that only root can read:
mkdir -p /opt/code-server && cd /opt/code-server
echo "PASSWORD=$(openssl rand -base64 32)" > .env
echo "SUDO_PASSWORD=$(openssl rand -base64 24)" >> .env
chmod 600 .env
Create the Compose file with nano docker-compose.yml:
services:
code-server:
image: lscr.io/linuxserver/code-server:4.145.2
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- PASSWORD=${PASSWORD}
- SUDO_PASSWORD=${SUDO_PASSWORD}
- DEFAULT_WORKSPACE=/config/workspace
volumes:
- ./config:/config
ports:
- "127.0.0.1:8443:8443"
restart: unless-stopped
Here’s what the entries mean:
image: code-server version 4.145.2, as used by the One-Click App. You can deliberately specify a new version later.PUIDandPGID: the user and group IDs that the editor runs under in the container. Files in theconfigdirectory will therefore belong to the user with ID 1000 on the server.PASSWORD: the login password from the.envfile. According to the documentation, if bothPASSWORDandHASHED_PASSWORDare missing, code-server starts without authentication. Instead of plain text, you can set an Argon2 hash withHASHED_PASSWORD. In the Compose file, write every$in the hash as$$.SUDO_PASSWORD: lets you usesudoin the terminal. If you leave out this line,sudowon’t be available../config:/config: the working directory, settings, extensions, and SSH keys are stored in theconfigdirectory beside the Compose file.127.0.0.1:8443:8443: code-server is accessible only from the server itself; external access goes through the reverse proxy.
Start the container:
docker compose up -d
Check whether it’s running with docker compose ps and view the logs with docker compose logs -f.
Install without Docker
code-server also provides an installation script that installs the appropriate package on Debian and Ubuntu: curl -fsSL https://code-server.dev/install.sh | sh. Add --dry-run at the end to preview what it would do. Then start the service with systemctl enable --now code-server@$USER. It listens on 127.0.0.1:8080, and the password is in ~/.config/code-server/config.yaml. This runs the editor directly on the server with your user’s permissions, not in a container.
Because code-server listens only on 127.0.0.1, it’s best to set up the reverse proxy from the next section first. For a quick test, open the editor from your computer through an SSH tunnel:
ssh -L 8443:localhost:8443 root@SERVER_IP
Replace SERVER_IP with your VPS’s IP address and open http://localhost:8443 in your browser. Log in with the password you can display on the server using grep PASSWORD /opt/code-server/.env.
To access code-server externally, put a reverse proxy with a valid certificate in front of it. For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). Important: code-server communicates with the browser over WebSockets. Without the Upgrade and Connection lines, the interface won’t load completely, and the terminal and editor will hang. Here’s an nginx server block based on the code-server documentation:
server {
listen 80;
listen [::]:80;
server_name code.example.com;
location / {
proxy_pass http://127.0.0.1:8443/;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}
Then get the certificate with certbot --nginx -d code.example.com. Certbot adds HTTPS and HTTP redirection to the block. With Caddy, two lines are enough because Caddy handles WebSockets and certificates automatically: code.example.com, followed by reverse_proxy 127.0.0.1:8443. For more security tips, see Linux Security Tips.
All data is stored in the config directory beside the Compose file. Briefly stop code-server to make a consistent backup:
cd /opt/code-server
docker compose stop
tar -czf /root/code-server-backup-$(date +%F).tar.gz config docker-compose.yml .env
docker compose start
Then copy the archive to a different storage location. It contains your passwords and SSH keys, so store it securely.
linuxserver.io recommends not updating programs inside the container. Instead, switch the image and recreate the container. To do this, specify the new version in docker-compose.yml—you can find it among the image releases—and restart:
cd /opt/code-server
docker compose pull
docker compose up -d
The config directory is preserved. As with the One-Click App, packages you installed in the container with apt will be gone. Remove old images with docker image prune.
After logging in, set up code-server for your projects. Everything in this section applies to both the One-Click App and the manual installation.
Open the terminal from the menu in the top left > Terminal > New Terminal. Clone your project in the working directory:
cd /config/workspace
git clone https://github.com/BENUTZER/REPO.git
In our test, the repository appeared directly in the file tree on the left. Before making your first commits, set your name and email address:
git config --global user.name "Dein Name"
git config --global user.email "du@example.com"
To access private repositories over SSH, create a key in the terminal with ssh-keygen -t ed25519 and add the public key from /config/.ssh/id_ed25519.pub to GitHub, GitLab, or your own Git server. The key is stored in the volume and will be preserved. For more information about Git on the server, see Install Git.
Install extensions using the Extensions icon on the left or by pressing Ctrl + Shift + X. The search uses Open VSX. The first time you install something from a publisher, code-server asks whether you trust them (Trust Publisher & Install). Extensions run code on your server, so check who they come from.
You can also install extensions from the terminal using their identifier:
/app/code-server/bin/code-server --install-extension ms-python.python
In our test, this command installed the Python extension, including its debugger, from Open VSX. Pylance, on the other hand, returned not found because it’s only available in the Microsoft Marketplace. For installations using the script without Docker, the command is simply code-server --install-extension .... If an extension isn’t available in Open VSX, you can download a .vsix file from the project’s releases and install it through the command palette using Extensions: Install from VSIX.
The container includes only basic tools. Install languages such as Python in the terminal using sudo:
sudo apt update
sudo apt install -y python3 python3-venv python3-pip
sudo will ask for the sudo password: for the One-Click App, this is SERVICE_PASSWORD_SUDOCODESERVER under App environment > Automatically generated values; for a manual installation, use the SUDO_PASSWORD value from your .env file. In our test, Python 3.12 was ready to use immediately afterward. It’s better to install tools needed only by your project in the working directory, such as Python packages in a virtual environment created with python3 -m venv .venv. These will be preserved during updates.
If you start a development server in a project, for example on port 3000, the documentation says you can access it at https://code.example.com/proxy/3000/, protected by the same login as code-server.
The browser captures many keyboard shortcuts, such as Ctrl + W. The code-server documentation therefore recommends installing the editor as an app: in Chrome, use the install icon in the address bar; on an iPad in Safari, tap Share > Add to Home Screen. code-server will then run in its own window and receive the keyboard shortcuts. On a computer that isn’t yours, it’s best to use a private browser window and close it afterward so no one can continue using your session.
- One login for everyone: code-server has just one password and no user accounts. For multiple people, it’s better to use a separate instance for each person, ideally on separate servers according to the documentation.
- No Docker in the editor: the Docker socket isn’t mounted in the One-Click App. So Docker commands for your projects won’t run in the code-server terminal; use SSH to run them on the VPS instead.
- No Microsoft Marketplace: Live Share, Pylance, and the Remote extensions are unavailable. For Python, Open VSX offers free language servers as alternatives, such as Pyrefly.
- Storage and memory: projects, dependencies, and language servers use disk space and RAM on the VPS. If you run short on resources, upgrade it in the Manage plan tab of your VPS.
You’ve set up code-server on your VPS, logged in, and learned how to get projects with Git, install extensions from Open VSX, add languages to the container, and back up your data. You now have VS Code on any device with a browser, from a tablet to a borrowed PC.
Prefer not to handle Docker yourself? Then take the easy route with the One-Click App, as described above under “The easy way: code-server as a One-Click App.”