We use cookies to make your experience better.
The original article was written by Joe Previte. We’ve refreshed it with new and updated links to help you set up code-server for your team.
In this article, we’ll explore various solutions to providing code-server for multiple users. Think of this as a high-level overview of real-world approaches to providing each of your users with their own instance of VS Code. All solutions are based on real things we’ve seen from the community.
When we launched code-server back in 2019, we had one goal in mind: bring VS Code to the web. Since then the project has grown beyond what we could have imagined. One of those ways is providing code-server for multiple users.
While we’ve developed our own solution to this problem, I want to explore all the solutions we’ve seen implemented by the community. The goal is to provide a holistic overview of each so you can decide which suits the needs of you and your team.
If you want to jump straight into code examples, take a look at these code-server setups for teams:
As a reminder, code-server itself is designed for single-player mode. You get a machine, you install code-server via a package manager or the release binaries. You start it up and boom, you have your IDE in a browser.
This drastically reduces the number of tools needed for your dev workflow to only two:
To add more users, we now need a solution. Over the years, we’ve seen many discussions come up around this problem. Let’s explore the ones that folks have shared with us and the pros and cons of each.
This is by far the simplest approach we’ve seen used. Your team has one machine with code-server installed. For each user, you run their own instance of code-server on different ports. Here’s a diagram with more details:
If you have fewer than five users, this approach may work for your team. More than that, you’re likely to run into problems.
A common approach we’ve seen is to have one machine run multiple Docker containers each with their own code-server instance. We use this approach for dev.coder.com but use Coder to orchestrate it. This is similar to the previous approach except the Docker containers run in isolation. That means no file conflicts. Here’s a diagram with more details:
Similar to the previous approach, it can work for small teams but you may run into limitations and need more machines.
One of the less popular approaches but still worth knowing is using minikube to set up a local Kubernetes cluster on your machine. Each container then has its own code-server instance.
This is similar to the previous approach with the exception being that it would be easier to migrate to a production Kubernetes environment (i.e. Google Kubernetes Engine) if needed.
Similar to the previous approach, it can work for small teams but you may run into limitations and need more machines.
Coder is our solution to this problem: a tool that provisions remote development environments via Terraform. With this solution, you can also support multiple IDEs beyond code-server including:
Coder is a flexible solution to manage all the above solutions so it’s not exactly an alternative. But it does have more features out-of-the-box and is much easier to set up. Taken from our docs, here’s a diagram with more details:
There’s definitely some bias here but this is the most proven solution for providing code-server to large teams in a way that scales. It’s dogfooded, battle-tested, and used by large enterprise companies whose names you probably know. Even if you’re not sure, it’s worth exploring this route.
For more in-depth info on these approaches, take a look at the following resources:
As you can see, there are various options for running code-server with multiple users. We covered the pros and cons of each solution. It’s up to you and your team to decide which will work best for your needs.
If you're interested in setting up Coder for your team and need help, join our Discord.
Good luck to you and your team! Happy coding!
Enjoy what you read?
Subscribe to our newsletter
By signing up, you agree to our Privacy Policy and Terms of service.