
Deploy code-server Go
Browser VS Code set up for Go with gopls
code-server
Just deployed
/home/coder
Deploy and Host self hosted code-server Go (Browser Go Development Environment) on Railway
This template runs a browser VS Code with the Go toolchain kept in your persistent home, so Go, gopls, dlv and the module cache survive redeploys.
About Hosting code-server Go open-source software on Railway (self hosted self-hosted browser IDE for Go development on Railway template)
This template runs one code-server service from the official codercom/code-server:4.141.0 image, which ships VS Code 1.141.0.
Railway handles the container, public HTTPS domain, health check and volume.
Why Deploy code-server Go, the GitHub Codespaces alternative on Railway (Railway Free Trial)
GitHub Codespaces bills compute and storage by the hour, so the cost grows with every session.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying code-server Go on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for code-server Go self hosting
Running code-server Go on a VPS means you manage the box yourself, while Railway gives you the service, volume and domain from one template.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One service with a persistent /home/coder volume and a public domain, with nothing to patch. | A Droplet you size and harden yourself, with code-server install work done by hand. |
| AWS | Go kept in your home volume with no VPC or IAM setup to maintain. | Fine-grained networking control, but EC2, EBS and TLS to wire up before gopls runs. |
| Hetzner | Domain and volume handled for you, so your ~/go install survives redeploys. | Low raw cost per core, but systemd, HTTPS and backups are on you. |
Railway trades some low-level control for a Go workspace you can verify in minutes.
Common Use Cases for hosted code-server Go
- Writing a Go HTTP service from a tablet: Open the workspace in iPad Safari or a Chromebook, edit handlers and run the service in the terminal with no local Go install. gopls gives you completion and jump-to-definition.
- Previewing a running server: Start your server on port 3000 and open https://your-domain/proxy/3000/ behind the same login. If the page breaks under the subpath, try /absproxy/3000.
- Debugging with dlv: Run "Go: Install/Update Tools" to get dlv, then set breakpoints and step through a request handler from the browser.
- Keeping ~/go across redeploys: Only /home/coder persists, so the Go install, module cache and PATH entries in ~/.profile survive restarts. Anything under /usr/local does not.
- Onboarding a teammate: A new contributor opens one URL, pastes the shared password and lands in a configured Go workspace, with no local Go version or GOPATH setup needed.
Dependencies for code-server Go Docker hosted on Railway
This template runs one code-server service from the official codercom/code-server image, so the Go toolchain, gopls and dlv live in a single container. Plan around that split first.
Deployment Dependencies for Managed code-server Go Service (Cloud IDE)
You need a Railway project with one service, a public domain, and a volume mounted at /home/coder.
Implementation Details for code-server Go (Using code-server official docker image)
Set PASSWORD, PORT=8080, DEFAULT_WORKSPACE=/home/coder/workspace and ENTRYPOINTD=/home/coder/.entrypoint.d on the service.
How does code-server Go compare against other ways to write and run Go in a browser IDE
code-server Go vs GitHub Codespaces (Hosted VS Code in the Browser)
- Where Codespaces wins: GitHub hosts it, so there is nothing to deploy, and personal accounts get a free monthly quota.
- Where code-server Go wins: Your Go toolchain lives under ~/go on the volume, so gopls and dlv survive redeploys.
- Billing: Codespaces bills per core-hour plus storage; this is one always-on service at a flat monthly cost.
code-server Go vs Gitpod (Cloud Development Environments)
- Where Gitpod wins: It builds ready-made workspaces from a repo URL with little setup.
- Where code-server Go wins: One workspace keeps its module cache and Go install between sessions.
- Billing: Gitpod is usage-based, so heavy use costs more here it does not.
code-server Go vs GoLand (JetBrains Desktop IDE)
- Where GoLand wins: It is a dedicated Go IDE with deep refactoring, debugging and profiling, running natively on your machine.
- Where code-server Go wins: You can open the same environment from an iPad or a Chromebook with nothing installed locally.
- Trade-off: You get the VS Code Go extension and dlv instead of JetBrains tooling.
code-server Go vs VS Code Remote SSH (Desktop VS Code Over SSH)
- Where Remote SSH wins: You keep desktop VS Code with native performance and every local extension.
- Where code-server Go wins: No SSH keys or local client; a browser tab and the password are enough.
- Port access: A Go server on port 3000 is reachable at /proxy/3000/ behind the same login.
How to use code-server Go (the OSS browser IDE)?
- Set PASSWORD, PORT=8080, DEFAULT_WORKSPACE=/home/coder/workspace and ENTRYPOINTD=/home/coder/.entrypoint.d on the service, then open the Railway domain and log in.
- In the terminal, download a Go tarball into /home/coder and extract it to /home/coder/go-sdk. Avoid /usr/local/go, since it is lost on redeploy.
- Add the Go and GOPATH bin directories to PATH in ~/.profile so they survive restarts.
- Install the extension with code-server --install-extension golang.go, or search "Go" in the Extensions sidebar. It comes from Open VSX.
- Run "Go: Install/Update Tools" to install gopls and dlv, then confirm the language server is running.
- Start your server on port 3000 and open https://your-domain/proxy/3000/ behind the same login.
cd /home/coder
curl -LO https://go.dev/dl/go1.21.13.linux-amd64.tar.gz
mkdir -p /home/coder/go-sdk
tar -C /home/coder/go-sdk -xzf go1.21.13.linux-amd64.tar.gz
export PATH="$PATH:/home/coder/go-sdk/go/bin:$HOME/go/bin"
How to self host code-server Go on other VPS Services (code-server self hosting guide)
You can run the same Go setup on any Linux VPS with Docker. These steps assume a fresh Ubuntu box.
Clone the Repository
Clone the template repository and move into it. The compose file pins the code-server image by tag and digest.
git clone https://github.com/your-org/code-server-go.git
cd code-server-go
Install Dependencies
You only need Docker and Docker Compose on the host. Go installs later inside the persistent home.
sudo apt-get update
sudo apt-get install -y docker.io docker-compose-plugin
Configure Environment Variables
Create a .env file next to the compose file. Set a strong password and keep the home volume on a host directory so your Go toolchain and module cache survive restarts.
cat > .env <<'EOF'
PASSWORD=your-long-random-password
PORT=8080
DEFAULT_WORKSPACE=/home/coder/workspace
ENTRYPOINTD=/home/coder/.entrypoint.d
EOF
Start the code-server Go Application
Run docker compose up -d and open port 8080, putting HTTPS in front with Caddy or nginx first. Railway handles the domain, volume and restarts for you.
Official Pricing of code-server Go (code-server pricing)
code-server is free and open source under the MIT license, so the editor, the Go extension, and the template cost nothing to license. Check the Railway pricing page for current rates.
code-server Go cloud vs self hosted comparison (Pricing, features, costs, and more)
Running code-server Go on Railway means one always-on container instead of per-seat or per-hour IDE billing. Here is what the costs and hardware look like.
Monthly cost of self hosting code-server Go on Railway
On Railway, one always-on code-server service at light to moderate use typically runs about $5 to $15 a month, depending on RAM use from gopls and your builds.
System Requirements for Hosting code-server Go on a VPS
On a VPS, plan for at least 1 to 2 GB of RAM for the editor plus gopls, and more for large modules. Go builds are CPU hungry, so a shared vCPU is fine for small services but slow on big compile loops.
Frequently Asked Questions (FAQs)
Do I need Go 1.21 or newer for the extension?
Yes. The VS Code Go extension requires Go 1.21 or newer and Visual Studio Code 1.125 or newer. Install a current toolchain into your home directory first.
Why is /usr/local/go not persisting?
Only /home/coder survives a redeploy, and /usr/local lives in the container filesystem. Install Go into a home-based directory and add its bin folder to PATH in ~/.profile.
How do I get gopls and dlv installed?
Run "Go: Install/Update Tools" from the command palette and select gopls and dlv. They install into $(go env GOPATH)/bin, which sits on your home volume, so they survive restarts.
Where does the module cache live on this template?
Your ~/go directory persists because it sits under /home/coder, and the module cache lives there too. Dependencies you download stay across redeploys.
Why does my Go server page break under /proxy/your-port/ and when do I use /absproxy?
The proxy strips the /proxy/your-port prefix, so apps that build absolute URLs can load assets from the wrong path.
Is the Go extension from the Microsoft marketplace or Open VSX?
It comes from Open VSX, which code-server uses. The Microsoft marketplace is licensed for Microsoft products only, so install golang.go from Open VSX through the Extensions sidebar.
Template Content
code-server
codercom/code-server:4.141.0