Installing, configuring, and maintaining Coder on a VPS allows you to deploy a centralized platform for remote development environments, providing teams with standardized and secure workspaces accessible from any browser, which streamlines the development process and reduces local hardware costs.
What is Coder and why do you need it on a VPS?
Coder (formerly Coder OSS) is a powerful self-hosted platform designed for creating and managing remote development environments. It allows engineers, developers, and data scientists to work on projects directly from a web browser, using standardized, high-performance, and secure workspaces. Instead of configuring local machines for each project or new team member, Coder provides a ready-to-use environment, deployed on a powerful server, available on demand.
Deploying Coder on a VPS (Virtual Private Server) is a strategic decision for many teams. A VPS provides dedicated resources, full control over the operating system, and scaling flexibility, which is critical for the stable operation of a platform managing dozens or even hundreds of development environments. This allows for centralized infrastructure management, simplifies onboarding for new employees, ensures uniformity of tools and versions, and enhances security by keeping source code and project data on a controlled server rather than on local machines.
Using Coder on a VPS offers several advantages: from reducing costs for high-performance local hardware to increasing productivity through instant access to ready-made environments. Developers can switch between projects without lengthy setups, and administrators gain a single point of control and monitoring for all workspaces.
Advantages of Coder on a VPS
- Standardization and Uniformity: Each development environment can be deployed from a common image, ensuring all developers use the same versions of tools, libraries, and dependencies, which minimizes "it works on my machine" issues.
- Fast Onboarding: New employees or team members can get a fully configured development environment in minutes, not hours or days.
- Security: Source code and sensitive data are stored on a centralized, controlled server, rather than on less secure local machines. Access to environments can be strictly regulated.
- Flexibility and Accessibility: Developers can work from anywhere, on any device (even a tablet or Chromebook) with a web browser.
- Resource Savings: Local machines do not require powerful hardware, as all computational load is transferred to the VPS.
- Scalability: As the team or number of projects grows, it's easy to scale VPS resources or add new servers to host additional environments.
- Environment Isolation: Each development environment is isolated, preventing dependency conflicts between different projects.
Comparison with Alternatives
Coder competes with several remote development solutions, each with its own characteristics:
- Code-Server: This is one of the most popular projects, allowing you to run VS Code in a browser. Code-Server on VPS: Installation, Configuration, and Maintenance is also an excellent solution for an individual developer or a small team. However, Coder offers a more comprehensive solution for managing multiple environments, resource orchestration, integration with cloud providers, and more advanced features for team collaboration and environment lifecycle management.
- Gitpod / GitHub Codespaces: These are cloud-based SaaS solutions. They offer similar functionality but run on the provider's infrastructure. Coder, being a self-hosted solution, gives you full control over data, security, and costs, as you use your own infrastructure (your VPS). This is especially important for companies with strict security and data privacy requirements.
- Local IDEs: The traditional approach where each developer configures their own machine. This can be complex, slow, and lead to compatibility issues. Coder solves these problems by offering a centralized and standardized approach.
System Requirements for Coder: Which VPS to choose?
Choosing the right VPS for Coder on a server is critically important for performance and stability. Coder itself does not require huge resources, but it manages many development environments, each consuming CPU, RAM, and disk space. Therefore, the overall requirements will depend on the number of concurrently running environments and their complexity.
Minimum Requirements for the Coder Server
To run the Coder server itself and a few light development environments (e.g., for simple web projects without heavy dependencies), you will need:
- Operating System: Ubuntu 20.04+, Debian 11+, CentOS 7+, RHEL 8+. Any modern Linux distribution with Docker support is recommended.
- Processor (CPU): 2 cores. This will be sufficient for Coder's operation and managing a few environments.
- Random Access Memory (RAM): 4 GB. The main Coder server consumes about 500 MB - 1 GB, the rest will go to the first environments.
- Disk Space: 50 GB NVMe SSD. NVMe is highly desirable for I/O-intensive operations typical for compilation and file handling.
- Docker and Docker Compose: Installed and configured.
- Domain Name: For accessing Coder via HTTPS.
Recommended VPS Configurations for Real Workloads
For team collaboration and support for more complex environments (e.g., with Java, Go, large databases, machine learning), requirements increase significantly. It is important to understand that each development environment is essentially a separate container or virtual machine that consumes resources.
When choosing a VPS for Coder, especially for teams, it is important to consider:
- Number of concurrent users: How many developers will be actively working in their environments simultaneously.
- Type of projects: Simple web projects on Node.js/Python require fewer resources than compiling large C++ projects or ML models.
- Storage requirements: Size of repositories, artifacts, data.
| Usage Scenario | Example Team | vCPU | RAM (GB) | Disk (NVMe SSD) | Example Valebyte.com Plan |
|---|---|---|---|---|---|
| Individual Developer / Testing | 1-2 users, light projects | 2-4 | 4-8 | 50-100 GB | VPS-4, VPS-8 |
| Small Team | 3-5 users, medium projects | 4-8 | 8-16 | 100-200 GB | VPS-8, VPS-16 |
| Medium Team | 6-15 users, complex projects | 8-16 | 16-32 | 200-400 GB | VPS-16, VPS-32 |
| Large Team / High Load | 15+ users, resource-intensive projects | 16+ | 32+ | 400+ GB | Dedicated Server / Custom Plan |
For Valebyte.com, plans with NVMe SSD and a sufficient number of cores are the optimal choice. For example, for a small team starting with Coder, the VPS-8 plan (8 GB RAM, 4 vCPU, 160 GB NVMe SSD) would be a good starting point, offering a balance between performance and cost.
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 Coder Installation on VPS with Docker Compose
The simplest and recommended way to install Coder on a VPS is by using Docker and Docker Compose. This approach provides isolation, portability, and simplifies dependency management. We will deploy a Coder Docker container, which is standard practice for self-hosted applications.
Server Preparation
Before proceeding with the Coder installation, you need to perform a few preliminary steps on your VPS:
- System Update: Always start by updating the package manager and installed packages.
sudo apt update && sudo apt upgrade -y - Docker Installation: Install Docker Engine and Docker Compose.
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 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 sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER newgrp dockerFor Docker Compose V2 (recommended), it is usually installed as a Docker plugin. If you have an older Docker version or a distribution where Compose V2 is not installed by default, you can install it like this:
sudo apt install -y docker-compose-pluginOr as a separate binary (Compose V1):
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-composeMake sure Docker is running:
sudo systemctl start docker sudo systemctl enable docker docker --version docker compose version - Git Installation: Coder often interacts with Git repositories.
sudo apt install -y git - Firewall Configuration (UFW): Open ports for SSH (22), HTTP (80), and HTTPS (443).
sudo ufw allow OpenSSH sudo ufw allow http sudo ufw allow https sudo ufw enable - Domain Name: Ensure your domain name (e.g.,
coder.yourdomain.com) points to your VPS's IP address.
Deploying Coder via Docker Compose
Create a directory for Coder files and Docker Compose configuration:
mkdir -p ~/coder
cd ~/coder
Create a docker-compose.yaml file:
nano docker-compose.yaml
Paste the following content. This is a basic configuration for a self-hosted Coder deployment:
version: "3.8"
services:
coder:
image: ghcr.io/coder/coder:latest
container_name: coder
restart: unless-stopped
environment:
# URL where Coder will be accessible. Replace with your domain.
CODER_EXTERNAL_URL: https://coder.yourdomain.com
# Directory for storing Coder data
CODER_DATA_DIR: /app/data
# Proxy settings for internet access from development environments (optional)
# HTTP_PROXY: http://your.proxy:port
# HTTPS_PROXY: https://your.proxy:port
# NO_PROXY: localhost,127.0.0.1
ports:
# Port that Coder will listen on inside the container.
# We will use a reverse proxy, so this port will not be exposed externally.
- "20000:8080"
volumes:
# Directory for storing Coder data on the host
- ./data:/app/data
# Docker socket to enable creating environments within Coder
- /var/run/docker.sock:/var/run/docker.sock
networks:
- coder-network
networks:
coder-network:
driver: bridge
Important: Replace https://coder.yourdomain.com with your actual domain name. Port 20000 is chosen as an example; you can use any free port, as long as it is accessible to your reverse proxy.
Start Coder:
docker compose up -d
Check that the container is running:
docker ps
You should see the coder container in the list.
Initial Coder Setup
After starting the container, Coder will be accessible via an internal address and port. To access it externally, we need a reverse proxy that will accept requests on your domain and forward them to Coder's internal port. Until then, you will not be able to access Coder through your browser via the domain name.
After configuring the reverse proxy and HTTPS, upon first accessing Coder through your browser, you will be prompted to create an administrator account. Follow the on-screen instructions to complete the initial setup.
Need a dedicated server?
Compare prices from top providers. Configure and order in minutes.
Configuring Reverse Proxy and HTTPS for Coder
For secure access to Coder on the server via a domain name and HTTPS protocol, you need to configure a reverse proxy. We will cover two popular options: Nginx and Caddy. Both options allow you to automatically obtain and renew SSL certificates from Let's Encrypt.
Configuring Nginx as a Reverse Proxy
Nginx is a powerful and widely used web server and reverse proxy. If it's not already installed, run:
sudo apt install -y nginx
Create a new configuration file for your domain (e.g., coder.yourdomain.com.conf):
sudo nano /etc/nginx/sites-available/coder.yourdomain.com.conf
Paste the following content, replacing coder.yourdomain.com with your domain and 20000 with the port you specified in docker-compose.yaml:
server {
listen 80;
listen [::]:80;
server_name coder.yourdomain.com;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name coder.yourdomain.com;
# SSL certificates will be configured by Certbot later
ssl_certificate /etc/letsencrypt/live/coder.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/coder.yourdomain.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/coder.yourdomain.com/chain.pem;
include /etc/nginx/snippets/ssl-params.conf; # Optional, for enhanced security
location / {
proxy_pass http://localhost:20000; # Port Coder listens on inside the container
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400; # Increase timeout for long sessions
proxy_send_timeout 86400;
}
}
Create a symbolic link to this file in sites-enabled:
sudo ln -s /etc/nginx/sites-available/coder.yourdomain.com.conf /etc/nginx/sites-enabled/
Test the Nginx configuration and reload it:
sudo nginx -t
sudo systemctl restart nginx
Issuing SSL Certificates with Certbot for Nginx
Install Certbot and the Nginx plugin:
sudo apt install -y certbot python3-certbot-nginx
Run Certbot to obtain a certificate:
sudo certbot --nginx -d coder.yourdomain.com
Follow Certbot's instructions. It will automatically update your Nginx configuration file to use HTTPS. Ensure Certbot is configured for automatic certificate renewal (this usually happens by default).
Configuring Caddy as a Reverse Proxy
Caddy is a modern web server with automatic HTTPS support, making it an excellent choice for simplifying configuration. If Caddy is not yet installed, follow the instructions on the official website or use the commands below for Ubuntu:
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 -y caddy
Create or edit the Caddyfile:
sudo nano /etc/caddy/Caddyfile
Remove existing content and paste the following, replacing coder.yourdomain.com with your domain and 20000 with the Coder port:
coder.yourdomain.com {
reverse_proxy localhost:20000 {
header_up Host {host}
header_up X-Real-IP {remote_ip}
header_up X-Forwarded-For {remote_ip}
header_up X-Forwarded-Proto {scheme}
# Increase timeout for long sessions
transport http {
read_timeout 1h
write_timeout 1h
keepalive_interval 30s
}
}
}
Caddy will automatically obtain and renew SSL certificates from Let's Encrypt. Check Caddy's configuration and reload the service:
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddy
Now you can open your domain https://coder.yourdomain.com in your browser and start working with Coder.
Managing Coder: Backups, Updates, and Monitoring
Effective management of the Coder platform deployed on your VPS includes regular backups, timely updates, and continuous monitoring. These practices ensure the stability, security, and relevance of your development environment.
Backup Strategies for Coder
Coder's data is stored in the directory you specified in docker-compose.yaml (in our case, it's ./data relative to the Compose file). This directory contains configurations, user data, databases, and environment metadata. It is important to regularly back up this directory.
- Stop Coder (optional, but recommended): For the most consistent backup, it's best to stop the Coder service during the backup.
cd ~/coder docker compose stop coder - Copy Data: Create an archive of the
datadirectory.tar -czvf coder_backup_$(date +%Y%m%d%H%M%S).tar.gz ./data - Move Backup: Move the archive to a safe location, preferably to a separate server or cloud storage. Never store the only copy of a backup on the same server as the original data. You can use
scp,rsync, or specialized tools. For more advanced scenarios, consider solutions like Restic on VPS: Installation, Configuration, and Maintenance, which support incremental backups and encryption. - Start Coder:
docker compose start coder
Automate this process using Cron jobs. For example, for a daily backup:
sudo crontab -e
Add the line (replace /path/to/coder with your actual path):
0 3 * * * /bin/bash -c "cd /path/to/coder && docker compose stop coder && tar -czvf coder_backup_$(date +\%Y\%m\%d\%H\%M\%S).tar.gz ./data && docker compose start coder && mv coder_backup_*.tar.gz /path/to/backup/destination/"
Be sure to regularly test the recovery process from backups.
Coder Update Procedure
Updating Coder is very simple if you are using Docker Compose:
- Navigate to the Coder directory:
cd ~/coder - Stop the current container:
docker compose stop coder - Pull the new image version:
docker compose pull coder - Start Coder with the new image:
docker compose up -d
Coder will automatically perform necessary database migrations on the first launch of the new image. It is always recommended to create a backup before updating.
Monitoring VPS Resources for Coder
Continuous monitoring of VPS resources is crucial, as Coder can dynamically create and manage many environments, each consuming CPU, RAM, and disk space. Overloading the VPS will lead to a slowdown in all environments.
- Using
htoportop: For a quick view of CPU, RAM usage, and active processes.htop - Monitoring Docker Containers:
docker statsThis command shows real-time resource consumption for each container, including Coder and all running development environments.
- Monitoring Disk Space:
df -hAllows you to track disk fullness. If environments create many artifacts or clone large repositories, the disk can quickly fill up.
- Monitoring Systems: For more serious installations, consider using Prometheus + Grafana, Zabbix, or your VPS provider's built-in monitoring tools. Setting up alerts for exceeding CPU, RAM, or disk thresholds will allow you to respond promptly to issues.
In case of consistently high load, this may be a signal to upgrade your VPS to a more powerful plan.
Optimal VPS Configuration for Coder under Real Workload
Choosing the optimal VPS configuration for Coder is a balance between cost and performance. It's important not to overpay for excessive resources, but also not to economize where it's critical for team productivity. Key factors influencing the choice:
- Number of active developers: This is the primary driver of resource consumption. Each active developer in their environment will consume CPU and RAM.
- Project complexity: Python/Node.js projects with light dependencies require less than C++ compilation, Java projects with large IDEs, or machine learning environments with GPU accelerators (which are less common on VPS).
- IDEs and tools used: Heavy IDEs (IntelliJ IDEA, GoLand, PyCharm) consume more resources than lightweight editors (VS Code).
- Data volume: Sizes of repositories, databases, Docker images, build artifacts.
Resource Calculation for Teams
Approximate resource calculation per active development environment:
- CPU: 1-2 vCPU (for light projects) up to 2-4 vCPU (for heavy compilations or ML).
- RAM: 2-4 GB (for light) up to 8-16 GB (for heavy).
- Disk: 20-50 GB per environment (plus space for Coder itself and common images).
Thus, for a team of 5 developers working on medium projects, you would need:
- vCPU: 5 * 2 (minimum) = 10 vCPU. But it's better to have a reserve, so 12-16 vCPU would be more comfortable.
- RAM: 5 * 4 GB = 20 GB. Considering the OS and Coder itself, 24-32 GB RAM would be optimal.
- Disk: 5 * 30 GB + 50 GB (for Coder and shared data) = 200 GB. NVMe SSD is mandatory.
This means that for such a team, a Valebyte.com plan with 16 vCPU, 32 GB RAM, and 400 GB NVMe SSD would be suitable. It's always better to start with a small reserve and scale resources as needed. Virtual Private Servers (VPS) on Valebyte.com's powerful infrastructure with NVMe disks provide an excellent foundation for Coder, ensuring high disk I/O speeds, which is critically important for development performance.
In addition to Coder, you can deploy other useful tools for your team on the same VPS, such as a CI/CD system like Woodpecker CI on VPS: Installation, Configuration, and Maintenance, or a project management system like Redmine on VPS: Installation, Configuration, and Maintenance, if resources allow.
Example Valebyte.com Plans for Coder
Valebyte.com offers various VPS plans suitable for Coder:
- VPS-4: 4 GB RAM, 2 vCPU, 80 GB NVMe SSD. Suitable for an individual developer or testing Coder.
- VPS-8: 8 GB RAM, 4 vCPU, 160 GB NVMe SSD. An excellent option for a small team (2-3 developers) with light-to-medium projects.
- VPS-16: 16 GB RAM, 8 vCPU, 320 GB NVMe SSD. Ideal for a medium team (up to 8-10 developers) or for more resource-intensive projects.
- VPS-32: 32 GB RAM, 16 vCPU, 640 GB NVMe SSD. Recommended for large teams (10-15+ developers) or for very demanding environments.
When choosing a plan, always consider peak load and planned team growth. NVMe SSD is a mandatory requirement for good development environment performance, as file read/write speed directly affects compilation time, dependency installation, and overall IDE responsiveness.
Need a dedicated server?
Compare prices from top providers. Configure and order in minutes.
Possible Problems and Their Solutions
During Coder installation and operation on a VPS, various difficulties may arise. Knowing typical problems and how to solve them will help quickly restore functionality.
Errors when starting Docker or Docker Compose
Cannot connect to the Docker daemon. Is the docker daemon running on this host?- Cause: Docker is not running or the user does not have permissions to work with Docker.
- Solution: Make sure Docker is running:
sudo systemctl status docker. If not, start it:sudo systemctl start docker. Add the user to thedockergroup:sudo usermod -aG docker $USER && newgrp docker. An SSH session restart may be required after this.
Port is already in use- Cause: The port you specified in
docker-compose.yaml(e.g., 20000) is already occupied by another application on your VPS. - Solution: Change the port in the
docker-compose.yamlfile to another free port (e.g., 20001) and update the reverse proxy configuration. You can find free ports with the commandsudo netstat -tulnp | grep LISTEN.
- Cause: The port you specified in
Error response from daemon: driver failed programming external connectivity on endpoint coder- Cause: Problems with Docker network configuration or firewall.
- Solution: Restart Docker:
sudo systemctl restart docker. Check firewall rules (UFW or firewalld) for traffic blocking. Ensure Docker networks do not conflict with other networks on the server.
Access and HTTPS Issues
ERR_CONNECTION_REFUSEDorConnection Timeoutwhen accessing by domain- Cause: Reverse proxy (Nginx/Caddy) is not running, incorrectly configured, or Coder is not listening on the expected port.
- Solution: Check Nginx/Caddy status:
sudo systemctl status nginxorsudo systemctl status caddy. Ensure Coder's port (e.g., 20000) is open on localhost:curl http://localhost:20000(you should get a response). Check Nginx/Caddy logs for errors. Make sure the domain name correctly points to your VPS's IP address.
- Error
NET::ERR_CERT_COMMON_NAME_INVALIDorCertificate is invalid- Cause: SSL certificate not issued, expired, or you are trying to access by IP address instead of domain name.
- Solution: Ensure Certbot has successfully issued a certificate for your domain and Nginx/Caddy is using it. Check certificate expiration:
sudo certbot certificates. Try renewing the certificate manually:sudo certbot renew --force-renewal. Make sure your browser is accessing Coder via the full domain name (e.g.,https://coder.yourdomain.com).
Optimizing Development Environment Performance
- Slow IDE performance or compilation
- Cause: Insufficient VPS resources (CPU, RAM) or slow disk.
- Solution: Check
htopanddocker statsduring active work. If CPU or RAM are consistently at 90%+ load, consider upgrading your VPS. Ensure your VPS uses NVMe SSD, as this is critical for I/O-intensive development tasks. Optimize your environment's Dockerfiles to be lightweight.
- Disk space filling up
- Cause: Accumulation of large numbers of Docker images, cache, logs, or build artifacts in environments.
- Solution: Regularly clean up unused Docker objects:
docker system prune -a(be careful, this removes all stopped containers, unused networks, images, and build cache). Configure disk space limits for environments in Coder's configuration. Implement cache cleaning strategies in your Docker images for development environments.
Conclusion
Deploying Coder on a VPS is an effective solution for centralizing and standardizing remote development environments, significantly increasing team productivity. For stable Coder operation, choose a VPS with sufficient NVMe SSD disk space and an adequate number of vCPUs and RAM, based on your team size and project complexity. Valebyte.com offers a wide range of VPS plans ideally suited for such tasks, ensuring high performance and reliability for your development infrastructure.
Ready to choose a server?
VPS and dedicated servers in 72+ countries with instant activation and full root access.
Get started now →