bolt Valebyte VPS from $4/mo — NVMe, 60s deploy.

Get a VPS arrow_forward

Code-server on VPS: Installation, Configuration, and Maintenance

calendar_month June 20, 2026 schedule 23 min read visibility 40 views
person
Valebyte Team
Code-server on VPS: Installation, Configuration, and Maintenance

code-server on VPS — is a remote IDE that allows you to run Visual Studio Code in a browser on your own server, providing a centralized, powerful, and accessible development environment from anywhere in the world. It's an ideal solution for developers who need flexibility, performance, and complete control over their workspace, regardless of the device they are using.

In the modern world of software development, the flexibility and accessibility of the work environment play a key role. Developers often face the need to work on projects from different devices, in different locations, while maintaining a unified, powerful, and familiar IDE. This is where code-server comes to the rescue — an open-source implementation of Visual Studio Code that runs on a remote server and is accessible via a web browser.

Using code-server on a VPS from Valebyte.com allows you to transform a virtual server into a full-fledged cloud workstation. You get not only the familiar VS Code interface but also all the benefits of powerful server hardware: fast processors, ample RAM, and high-performance NVMe drives. This solution is ideal for working with resource-intensive projects, containerized applications, machine learning, or simply for maintaining a consistent development environment for a team.

In this article, we will delve into what code-server is, what its advantages are when hosted on a VPS, what system requirements are necessary, and guide you through a step-by-step installation, configuration, and maintenance process. We will focus on containerization with Docker and Docker Compose, setting up secure access via a Reverse Proxy with HTTPS, as well as backup and update considerations. Finally, we will help you choose the optimal VPS configuration for your tasks.

What is code-server and why is it needed on a VPS?

code-server is an open-source project that allows you to run Microsoft Visual Studio Code on a remote server and access it via any modern web browser. Essentially, it's "VS Code in the browser." It retains all the functionality of the desktop version: extension support, terminal, debugger, Git integration, and much more. All the computational load falls on the server, while your local computer acts merely as a "thin client."

Advantages of self-hosted code-server on a server

Hosting code-server self-hosted on your own server, especially on a VPS, offers a number of significant advantages:

  1. Accessibility from Anywhere: You can access your development environment from any device (laptop, tablet, even a smartphone) from anywhere in the world with internet access. All your projects, settings, and extensions are always at your fingertips.
  2. Consistent Development Environment: Ensures that all team members have the same development environment, regardless of their local OS or settings. This minimizes "it works on my machine" problems.
  3. Centralized Resources: Instead of relying on the power of your local device, you utilize the resources of a powerful VPS. This is especially relevant for compiling heavy projects, working with Docker containers, running tests, or machine learning tasks that require significant CPU and RAM.
  4. Security and Control: All your source code and data remain on your server, not on local devices that could be lost or compromised. You have complete control over the security and access to your data.
  5. Flexibility and Scalability: You can easily scale VPS resources as project or team needs grow. Adding more RAM or CPU is a matter of a few clicks in the Valebyte.com control panel.
  6. Local Resource Savings: Your local computer is not burdened with heavy tasks, which extends its battery life and preserves performance for other tasks.

Ultimately, code-server on a server becomes a powerful tool for remote development, providing performance, accessibility, and security that are difficult to achieve with purely local solutions.

System requirements for installing code-server on a VPS and server preparation

Before proceeding with the code-server installation, you need to ensure that your VPS meets the minimum system requirements and is properly prepared. While code-server itself doesn't demand extreme resources, the total memory and CPU consumption will depend on the number of concurrent users, project complexity, programming languages used, and installed extensions.

Minimum and recommended VPS resources

For comfortable work with code-server, it's important to choose the right VPS plan. Here are general recommendations:

  • Operating System (OS): Any modern Linux distribution. Ubuntu Server (20.04 LTS or newer), Debian (11 or newer), or CentOS Stream are recommended. These OSes are well-supported and have up-to-date packages.
  • Processor (CPU):
    • Minimum: 1 vCPU with a frequency of 2 GHz or higher. This is sufficient for a single user working on light projects (e.g., frontend development without heavy builds).
    • Recommended: 2 vCPU with a frequency of 2.5 GHz or higher. Will ensure smoother operation, especially when using multiple extensions, compiling, or running containers.
    • For teams/heavy projects: 4+ vCPU.
  • Random Access Memory (RAM):
    • Minimum: 2 GB. Will allow running code-server and working with small projects.
    • Recommended: 4 GB. Will ensure comfortable work with most projects, allow running Docker containers, and using more extensions.
    • For teams/heavy projects: 8+ GB.
  • Disk Space:
    • Minimum: 20 GB NVMe SSD. A fast NVMe drive is critical for IDE loading speed, file operations, and compilation.
    • Recommended: 50 GB NVMe SSD. Will provide enough space for the OS, Docker images, several projects, and potential backups.
  • Network Connection: Stable internet connection with a bandwidth of at least 100 Mbit/s.

Preliminary server setup

Before installing code-server docker, you need to perform a few basic steps to prepare your VPS:

  1. System Update: Always start by updating the package database and installed packages.
    sudo apt update && sudo apt upgrade -y
    
  2. Docker Installation: code-server will run in a container, so Docker is a key component.
    # Install necessary packages
    sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
    
    # Add Docker's GPG key
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
    # Add Docker repository
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    # Update package list and install Docker Engine
    sudo apt update
    sudo apt install docker-ce docker-ce-cli containerd.io -y
    
    # Add current user to the docker group (to avoid using sudo with docker commands)
    sudo usermod -aG docker $USER
    # To apply changes, you need to log out and log back in, or execute:
    # newgrp docker
    
  3. Docker Compose Installation: For convenient container management.
    # Download Docker Compose
    sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    
    # Assign execute permissions
    sudo chmod +x /usr/local/bin/docker-compose
    
    # Verify installation
    docker-compose --version
    
  4. Firewall Configuration (UFW): It is recommended to configure a basic firewall for enhanced security.
    sudo apt install ufw -y
    sudo ufw allow ssh
    sudo ufw allow http
    sudo ufw allow https
    # If you plan to use code-server without a reverse proxy on a non-standard port,
    # for example, 8080, then it also needs to be allowed:
    # sudo ufw allow 8080/tcp
    sudo ufw enable
    

After completing these steps, your VPS will be ready for code-server installation.

Looking for a reliable server for your projects?

VPS from $10/month and dedicated servers from $9/month with NVMe, DDoS protection, and 24/7 support.

View offers →

Step-by-step installation of code-server on VPS using Docker and Docker Compose

Installing code-server on a VPS using Docker and Docker Compose is the most recommended method. It provides isolation, simplifies dependency management, and facilitates updates. We will use the official code-server image.

Creating a Docker Compose file for code-server

Let's start by creating a directory for our project and the docker-compose.yml file. This directory will contain all the necessary configuration files and data for code-server.

mkdir -p ~/code-server
cd ~/code-server
nano docker-compose.yml

Paste the following content into the docker-compose.yml file:

version: '3.8'

services:
  code-server:
    image: ghcr.io/coder/code-server:latest
    container_name: code-server
    restart: unless-stopped
    ports:
      - "8080:8080" # Port for accessing code-server. Can be changed if 8080 is occupied.
    volumes:
      - ./config:/home/coder/.config # To save code-server configuration
      - ./projects:/home/coder/projects # For your working projects
      - /var/run/docker.sock:/var/run/docker.sock # Optional: for working with Docker from within code-server
    environment:
      # Replace 'YOUR_SECURE_PASSWORD' with your strong password
      - PASSWORD=YOUR_SECURE_PASSWORD
      - DOCKER_USER=${USER} # Pass the current Docker user's name to the container
      - DOCKER_GID=999 # Pass the GID of the Docker group (check 'getent group docker' on the host)
      - TZ=Europe/Moscow # Set your timezone
    user: "1000:1000" # Default user and group for code-server.
                     # If you want to use your host user,
                     # replace with $(id -u):$(id -g) or specific UID/GID.

Explanations for docker-compose.yml:

  • image: ghcr.io/coder/code-server:latest: Uses the latest official code-server image.
  • container_name: code-server: Assigns an easily recognizable name to the container.
  • restart: unless-stopped: The container will automatically restart after failures or server reboots.
  • ports: - "8080:8080": Maps port 8080 from the container to port 8080 of the host system. This is the port you will use to access code-server. You can change the external port (the first number) to any other free port, for example "8888:8080".
  • volumes:: Defines mounted volumes for data persistence:
    • ./config:/home/coder/.config: Saves code-server and VS Code settings (extensions, user settings) to the ~/code-server/config directory on your VPS.
    • ./projects:/home/coder/projects: This is where all your projects will be stored. This allows for easy file management and persistence even when recreating the container.
    • /var/run/docker.sock:/var/run/docker.sock: (Optional) Allows running Docker commands from the terminal inside code-server. This is useful if you are developing Docker containers or using Docker Compose in your projects. Important: this grants the container full access to the host's Docker daemon, which can be a security risk. Use with caution.
  • environment:: Sets environment variables:
    • PASSWORD=YOUR_SECURE_PASSWORD: Be sure to replace YOUR_SECURE_PASSWORD with a strong password! This is the password for logging into code-server.
    • DOCKER_USER, DOCKER_GID: Used in conjunction with mounting docker.sock for proper Docker operation from within the container. Ensure that the GID of the Docker group on your host matches the one specified (usually 999 or 1000). You can check it with the command getent group docker.
    • TZ=Europe/Moscow: Sets the timezone for the container.
  • user: "1000:1000": Runs the code-server process inside the container as a user with UID 1000 and GID 1000. This is the standard coder user in the image. If you want files created in the container to have the same permissions as on the host, you can use $(id -u):$(id -g), but this requires more complex access rights configuration for the mounted volumes.

After saving the docker-compose.yml file, create empty directories for the volumes:

mkdir config projects

Starting code-server and initial access

Now that the docker-compose.yml file is created, you can start code-server:

docker-compose up -d

The up -d command will start the container in the background. You can check the container status:

docker-compose ps

And view logs for debugging:

docker-compose logs -f code-server

After successful startup, code-server will be accessible at your VPS's IP address and the specified port. For example, if your VPS IP is 192.0.2.1 and you are using port 8080, the URL will be http://192.0.2.1:8080.

Upon first access, you will be prompted to enter the password you specified in the PASSWORD environment variable in the docker-compose.yml file.

Now that the code-server installation is complete and you can access it, the next step will be to configure secure access via a domain name and HTTPS.

rocket_launch Quick pick

Need a dedicated server?

Compare prices from top providers. Configure and order in minutes.

Browse dedicated servers arrow_forward

Configuring secure access to code-server: Reverse Proxy (Nginx/Caddy) and HTTPS

Direct access to code-server via IP address and port 8080 is not a secure or professional solution. To ensure security, use a domain name, and encrypt traffic (HTTPS), you need to set up a Reverse Proxy. In this section, we will cover configuring Nginx and Caddy — two popular web servers that excel at this task.

Why do you need a Reverse Proxy?

  • HTTPS: Provides traffic encryption between your browser and code-server, protecting your data from interception. Let's Encrypt provides free SSL/TLS certificates.
  • Domain Name: Access code-server via a convenient domain name (e.g., ide.yourdomain.com) instead of an IP address and port.
  • Security: A Reverse Proxy can act as a first layer of defense, hiding the actual code-server port and allowing you to configure additional security rules.
  • Multiplexing: Allows you to run multiple web applications on a single VPS, using different subdomains or paths, and route traffic to the corresponding containers.

For configuration, you will need a domain name (or subdomain) pointing to your VPS's IP address.

Configuring Reverse Proxy with Nginx and Let's Encrypt

Nginx is a powerful and widely used web server that is excellent for acting as a Reverse Proxy.

1. Install Nginx

sudo apt update
sudo apt install nginx -y
sudo ufw allow 'Nginx Full' # Open ports 80 and 443 for Nginx
sudo ufw delete allow http # Close port 80 if it was opened earlier for code-server

2. Create Nginx configuration file

Create a new configuration file for your domain (e.g., ide.yourdomain.com.conf) in the /etc/nginx/sites-available/ directory.

sudo nano /etc/nginx/sites-available/ide.yourdomain.com.conf

Paste the following content, replacing ide.yourdomain.com with your actual domain:

server {
    listen 80;
    listen [::]:80;

    server_name ide.yourdomain.com; # Replace with your domain

    location / {
        proxy_pass http://localhost:8080; # Port where code-server is running
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_set_header Accept-Encoding gzip;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

3. Activate Nginx configuration

Create a symbolic link to the configuration file in sites-enabled and check Nginx syntax:

sudo ln -s /etc/nginx/sites-available/ide.yourdomain.com.conf /etc/nginx/sites-enabled/
sudo nginx -t

If the syntax is okay, restart Nginx:

sudo systemctl restart nginx

Now code-server should be accessible via your domain over HTTP.

4. Install Let's Encrypt with Certbot for HTTPS

Certbot automates the process of obtaining and installing SSL/TLS certificates.

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d ide.yourdomain.com # Replace with your domain

Follow Certbot's instructions. It will automatically modify the Nginx configuration to use HTTPS and set up automatic certificate renewal.

After this, code-server will be accessible via https://ide.yourdomain.com, and all traffic will be encrypted.

Configuring Reverse Proxy with Caddy

Caddy is a modern web server known for its simple configuration and automatic HTTPS support via Let's Encrypt. It's an excellent alternative to Nginx if you prefer a more minimalistic approach.

1. Install Caddy

Follow the instructions on the official Caddy website for your OS. For Ubuntu, it would look like this:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy -y
sudo ufw allow 'Caddy Full' # Open ports 80 and 443 for Caddy
sudo ufw delete allow http # Close port 80 if it was opened earlier for code-server

2. Create Caddyfile

Caddy uses a configuration file called Caddyfile. Create it:

sudo nano /etc/caddy/Caddyfile

Delete all default content and paste the following, replacing ide.yourdomain.com with your actual domain:

ide.yourdomain.com { # Replace with your domain
    reverse_proxy localhost:8080 { # Port where code-server is running
        header_up Host {host}
        header_up Upgrade {header.Upgrade}
        header_up Connection {header.Connection}
        header_up X-Forwarded-For {remote}
        header_up X-Forwarded-Proto {scheme}
    }
}

3. Activate Caddy configuration

Check the Caddyfile syntax:

sudo caddy validate --config /etc/caddy/Caddyfile

If everything is in order, reload Caddy:

sudo systemctl reload caddy

Caddy will automatically obtain an SSL/TLS certificate from Let's Encrypt and configure HTTPS. Now your code-server will be accessible via https://ide.yourdomain.com.

The choice between Nginx and Caddy depends on your preferences and experience. Nginx is more flexible and widely used, Caddy is simpler to configure, especially for HTTPS.

Maintaining code-server: backups, updates, and monitoring

After successfully installing code-server on your VPS and configuring secure access, it's important to pay attention to its regular maintenance. This includes creating backups, timely updating components, and monitoring system status. Proper maintenance ensures stability, security, and data integrity.

Backup strategies for code-server

Backup is the cornerstone of any server infrastructure. For code-server, it's critical to save at least two categories of data:

  1. code-server and VS Code configuration: This includes installed extensions, user settings, themes, and more. This data is stored in the ./config volume that we defined in docker-compose.yml (/home/coder/.config inside the container).
  2. Working projects: All your source codes, project files, and other data stored in the ./projects volume (/home/coder/projects inside the container).

Recommended backup methods:

  • Git for projects: For project source codes, it is highly recommended to use a version control system like Git, with a remote repository (GitHub, GitLab, Bitbucket). This provides versioning and easy recovery.
  • Volume copying: You can simply copy the ~/code-server/config and ~/code-server/projects directories to an external drive or cloud storage.
    # Stop code-server before backup to avoid data corruption
    docker-compose down
    
    # Create an archive
    tar -czvf code-server_backup_$(date +%Y%m%d%H%M%S).tar.gz ~/code-server/config ~/code-server/projects
    
    # Start code-server
    docker-compose up -d
    

    This archive can then be transferred to another machine or to the cloud.

  • Using specialized tools: For more complex scenarios, you can use tools such as Restic on VPS: installation, configuration, and maintenance, which supports deduplication, encryption, and various storage backends (S3, SFTP, etc.).
  • VPS Snapshots: Most hosting providers, including Valebyte.com, offer a VPS snapshot feature. This allows you to create a complete copy of the entire server state. This is useful for quick recovery after major failures, but not always optimal for frequent incremental backups.

Important backup recommendations:

  • Perform backups regularly. The frequency depends on your work intensity.
  • Store backups in at least two different locations (3-2-1 rule: 3 copies of data, on 2 different media, 1 of which is off-site).
  • Verify backups for integrity and restorability.

Updating code-server and system components

Regular updates are critical for security and new features.

  1. Updating code-server: Since we use Docker, updating code-server is very simple.
    cd ~/code-server
    docker-compose pull code-server # Download the latest image version
    docker-compose up -d --force-recreate code-server # Recreate the container with the new image
    

    This will download the freshest image with the latest tag and restart your container without affecting your data stored in the volumes.

  2. Updating Docker and Docker Compose:
    sudo apt update
    sudo apt upgrade docker-ce docker-ce-cli containerd.io -y # For Docker
    # For Docker Compose (if installed manually):
    # Check the latest version on GitHub and repeat the installation steps:
    # sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    # sudo chmod +x /usr/local/bin/docker-compose
    
  3. Updating OS and other packages: Regularly update the operating system and all installed packages.
    sudo apt update && sudo apt upgrade -y
    sudo apt autoremove -y # Remove unnecessary dependencies
    

Monitoring VPS status

Monitoring helps you detect performance or availability issues in a timely manner.

  • Using htop/top: Simple command-line utilities for viewing CPU, RAM usage, and running processes.
    htop
    
  • Docker Monitoring:
    docker stats # Shows resource usage for all running containers
    docker logs -f code-server # View code-server logs
    
  • Hosting control panel: Valebyte.com provides a control panel with graphs of CPU, RAM, disk, and network usage for your VPS. Check it regularly to ensure resources are not exhausted.
  • Monitoring tools: For more advanced monitoring, you can set up systems like Prometheus + Grafana, or use cloud solutions.

Careful attention to maintenance will allow you to enjoy stable and secure operation of code-server on your VPS.

Choosing the optimal VPS configuration for code-server under real load

The correct choice of VPS configuration for code-server is critical to ensure comfortable and productive work. A server that is too weak will lead to delays and frustration, while one that is too powerful will result in unnecessary expenses. The optimal choice depends on your specific tasks: the number of users, project complexity, programming languages used, and extensions.

Factors influencing VPS configuration choice

  1. Number of concurrent users:
    • 1 user: Requires minimal resources, as the load is generated by only one person.
    • 2-5 users: Each additional user increases CPU and RAM consumption, especially if they are working on different projects or running resource-intensive tasks.
    • 5+ users: Requires a significantly more powerful server, possibly even with multiple code-server instances or load balancing.
  2. Project complexity:
    • Light projects (HTML/CSS/JS, small Python scripts): Do not require many resources.
    • Medium projects (Node.js, PHP, Ruby on Rails, Go): May require more RAM for dependencies and CPU for compilation/transpilation.
    • Heavy projects (Java, C++, .NET, ML models, large monorepositories): Consume a lot of CPU during build and compilation, as well as significant amounts of RAM.
  3. Programming languages and tools used:
    • Compiled languages (Java, C++, Go, Rust) stress the CPU.
    • Languages with many dependencies (Node.js, Python with ML libraries) consume RAM.
    • Using Docker/Kubernetes within code-server requires additional resources.
  4. Number and type of VS Code extensions: Some extensions can be quite resource-intensive (e.g., code analyzers, linters, debuggers).
  5. Disk type: NVMe SSD significantly outperforms regular SSDs in read/write speed, which is critical for fast project loading, dependency installation, and working with a large number of files. Valebyte.com offers VPS with NVMe drives.

Recommended VPS configurations for code-server

Here is a table with recommended VPS configurations for various code-server usage scenarios. The prices provided are approximate and may vary depending on the provider and region.

Usage Scenario vCPU RAM (GB) Disk (NVMe SSD) Approximate Cost/Month Notes
Light/Personal
(1 user, light JS/Python/PHP projects, frontend)
1-2 2 25-50 GB $5 - $10 Good for learning, simple websites, scripts. Can be slow with heavy builds.
Medium/Team Start
(1-3 users, medium Node.js/Python/Go projects, Docker)
2-4 4-8 50-100 GB $15 - $30 Optimal for most web developers. Allows running multiple containers.
Heavy/Performance
(3-5+ users, Java/C++/ML projects, large monorepositories, CI/CD)
4-8+ 8-16+ 100-200+ GB $40 - $80+ For intensive development, large teams, resource-intensive builds and testing. Consider Woodpecker CI on VPS: installation, configuration, and maintenance for CI/CD integration.

Additional recommendations:

  • Start small: You can always start with a more modest configuration and scale resources if needed. Monitoring resource usage (CPU, RAM) will help determine when it's time to upgrade.
  • NVMe is a must: For a development environment, disk speed plays a huge role. NVMe drives significantly accelerate file operations, compilation, and application startup.
  • VPS Location: Choose a VPS location that is closest to you and your team to minimize latency when working with code-server.
  • Dedicated IPs: For code-server, it is always recommended to use a VPS with a dedicated IP address, which simplifies DNS and Reverse Proxy configuration.

By choosing a VPS from Valebyte.com, you get flexible tariff plans, high-performance NVMe drives, and reliable infrastructure, making our VPS an ideal platform for hosting code-server on VPS.

rocket_launch Quick pick

Need a dedicated server?

Compare prices from top providers. Configure and order in minutes.

Browse dedicated servers arrow_forward

Common problems and their solutions when working with code-server

Even with the most careful code-server installation, unforeseen problems can arise. Knowing common errors and how to fix them will help you get back to work quickly. Below is a list of typical problems and their solutions.

1. Cannot connect to code-server via IP:port

  • Problem: The browser shows "Connection refused", "Site can't be reached", or "This site can’t be reached".
  • Possible causes and solutions:
    1. Firewall (UFW): Make sure the port on which code-server is running (default 8080) is allowed in your firewall.
      sudo ufw status # Check UFW status
      sudo ufw allow 8080/tcp # Allow port 8080
      sudo ufw reload # Reload UFW
      
    2. Container not running: Check that the code-server Docker container is running.
      cd ~/code-server
      docker-compose ps
      

      If the container is not running, try starting it: docker-compose up -d. Check logs for errors: docker-compose logs -f code-server.

    3. Incorrect port: Make sure you are using the correct port specified in the ports section of your docker-compose.yml (e.g., "8080:8080" means the external port is 8080).
    4. VPS network issue: Ensure your VPS has an active network connection and is accessible externally.

2. Problems with access via Reverse Proxy (Nginx/Caddy)

  • Problem: The domain does not open, or code-server does not load after Reverse Proxy configuration.
  • Possible causes and solutions:
    1. DNS records: Make sure your domain's DNS record (A-record for ide.yourdomain.com) points to your VPS's IP address.
    2. Nginx/Caddy configuration: Carefully check the Nginx configuration file (/etc/nginx/sites-available/ide.yourdomain.com.conf) or Caddyfile (/etc/caddy/Caddyfile) for typos.
      # For Nginx
      sudo nginx -t # Check syntax
      sudo systemctl restart nginx # Restart Nginx
      # For Caddy
      sudo caddy validate --config /etc/caddy/Caddyfile # Check syntax
      sudo systemctl reload caddy # Reload Caddy
      
    3. HTTPS certificate: If you are using HTTPS, ensure that the Let's Encrypt certificate has been successfully obtained and installed. Check Certbot or Caddy logs.
    4. Port 8080 only accessible locally: Make sure your Reverse Proxy can access code-server via localhost:8080 (or any other port if you changed it).

3. Slow code-server performance or resource shortage

  • Problem: The IDE runs slowly, freezes, compilation takes a long time.
  • Possible causes and solutions:
    1. Insufficient VPS resources: Check your VPS's CPU and RAM usage.
      htop # Resource usage overview
      docker stats # Container resource usage
      

      If resources are consistently at their limit, consider upgrading your VPS to a more powerful plan on Valebyte.com (e.g., from 2 vCPU/4GB RAM to 4 vCPU/8GB RAM).

    2. Slow disk: Make sure your VPS uses NVMe SSD. If not, this could be the cause of slowdowns.
    3. Problematic extensions: Some VS Code extensions can be resource-intensive. Try disabling recently installed extensions and check performance.
    4. Too many running processes: Check if there are other resource-intensive applications running on your VPS.

4. File/folder permission issues

  • Problem: Cannot save files, create directories, or Git operations fail with permission errors.
  • Possible causes and solutions:
    1. Incorrect user/group in Docker Compose: Make sure the user running code-server in the container has write permissions to the mounted volumes (./config and ./projects). In our docker-compose.yml, we use user: "1000:1000". Ensure these directories on the host belong to this user or have appropriate permissions.
      sudo chown -R 1000:1000 ~/code-server/config ~/code-server/projects
      

      Or, if you want to use your host user's UID/GID:

      # In docker-compose.yml, change:
      # user: "${PUID}:${PGID}"
      # Where PUID and PGID will be taken from environment variables
      # And then in a .env file (in the same directory as docker-compose.yml):
      # PUID=$(id -u)
      # PGID=$(id -g)
      
    2. Incorrect permissions for docker.sock: If you are mounting /var/run/docker.sock and encounter problems working with Docker from within code-server, ensure the user in the container has access to the Docker socket (this is why we passed DOCKER_GID).

5. code-server update issues

  • Problem: After updating code-server via docker-compose pull and up -d --force-recreate, the IDE does not start or works incorrectly.
  • Possible causes and solutions:
    1. Problems with the new image: Sometimes new versions may have bugs. Check the official code-server GitHub repository for known issues. You may need to revert to a previous stable version by specifying its tag in docker-compose.yml (e.g., ghcr.io/coder/code-server:4.20.0).
    2. Extension conflicts: A new version of code-server may be incompatible with some older extensions. Try temporarily disabling all extensions to see if this resolves the problem.
    3. Corrupted volumes: Rarely, but volumes can become corrupted. If you have a backup, try restoring it.

When any problems arise, always start by checking the code-server container logs using docker-compose logs -f code-server. Logs often contain valuable information that will help identify the root cause of the problem.

Conclusion

Deploying code-server on a VPS from Valebyte.com provides developers with a powerful, flexible, and secure environment for remote work, combining the convenience of Visual Studio Code with the performance of dedicated server resources. By following the step-by-step instructions for installation via Docker Compose, configuring secure access with a Reverse Proxy, and implementing maintenance strategies, you can create a stable and efficient platform for individual or team development.

For optimal performance, we highly recommend choosing a VPS with NVMe drives and sufficient RAM (from 4 GB) and CPU (from 2 vCPU) to ensure a smooth and responsive user experience, especially when working with resource-intensive projects. Valebyte.com offers a wide selection of VPS configurations that are ideally suited for all code-server usage scenarios, guaranteeing high performance and reliability.

Ready to choose a server?

VPS and dedicated servers in 72+ countries with instant activation and full root access.

Start now →
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.