Running a Browser-Based Remote Workbench for AI Coding Assistants Securely
A browser-based remote workbench keeps your AI coding assistant running on a fixed cloud server while your local machine only handles display and input. This guide walks through deploying code-server with Docker, securing access with Tailscale or SSH tunneling, and maintaining a stable, centralized development environment. It also covers compliance considerations and troubleshooting tips. If you struggle with unstable login states when switching networks, or juggle code scattered across multiple machines, this architecture may help.
1. Background and Problem
Developers using overseas AI coding tools often run into two problems.
The first is unstable network paths. When the same account frequently switches between different networks and regions, the platform may flag the login environment as abnormal, triggering re-verification or feature restrictions.
The second is scattered development environments. Code, scripts, and dependencies spread across multiple laptops and desktops mean reconfiguring everything every time you switch devices.
In my early days, I ran the tools directly on my local machine. Every network change caused login issues. I later moved to centralized development on a fixed server, and this setup has been running in my personal environment for over two months. That said, it’s personal experience only—no guarantee it fits every scenario.
The focus of this article is to reduce instability caused by environment switching while restricting access to authorized devices only. This article does not discuss bypassing regional restrictions or platform rules. Before getting started, please read the relevant tool’s terms of service.
2. Overall Architecture
The setup consists of three parts:
- Cloud server: A cloud host in an overseas region that hosts the code and development tools. File I/O, command execution, and dependency installation all happen on this machine.
- Web-based editor: The open-source code-server runs on the server, bringing the VS Code interface into your browser—including the file tree, editor area, and terminal. The AI coding extension is installed inside this editor.
- Private networking tool: This article uses Tailscale to put your local machine and the server into the same private network. Only devices logged into the same account can reach the workbench.
In short: the interface lives in the browser, execution happens on the server, and the model runs in the cloud.
3. Why Use a Browser as the Entry Point
3.1 Execution Environment Stays Fixed on the Server
If you run the AI coding tool directly on your local machine, the tool process uses your local egress IP, timezone, and system information. Once the network changes, these characteristics change too, making it easier for the platform to flag the session as abnormal.
With the browser approach, your local machine only renders pages and accepts input. The tool process runs on the server, whose egress address and system environment stay stable over time.
3.2 Feature Scope Depends on Extension Documentation
Using a web-based editor requires the extension to work properly in code-server. code-server uses the Open VSX extension marketplace by default, and some extensions are only published on Microsoft’s official marketplace, so they may not install directly. Before installing, confirm that the extension supports running in a web-based editor. If the extension bundles command-line programs, its capabilities are defined by the extension’s official documentation. The browser UI may differ from the desktop client, so real-world testing is necessary.
3.3 Centralized Logs and Environment
All runtime logs are stored on the server. When connection issues arise, SSH into the server and check container logs, Tailscale status, and port listening states separately. Projects, dependencies, and configurations also live on this machine, so switching local devices doesn’t lose anything.
4. Deployment Steps
4.1 Prepare the Cloud Server
Before choosing a cloud host in an overseas region, confirm that your intended usage complies with the terms of service. Ubuntu 22.04 or 24.04 LTS is recommended. 2 cores and 4 GB RAM is enough to get started, but 4 GB or more is safer when running the editor, extensions, and build tasks simultaneously. These specs are for reference only—actual requirements depend on project size.
After logging into the server, update the system and install basic tools:
sudo apt update && sudo apt install -y curl git
4.2 Install Docker and Deploy code-server
Running code-server in a container makes upgrades and isolation easier. Install Docker first:
curl -fsSL https://get.docker.com | sudo sh
Create the working directory and set its ownership so the container’s coder user (UID 1000) can write to it:
mkdir -p ~/workspacesudo chown -R 1000:1000 ~/workspace
Don’t put the login password directly in the command line. Store it in an environment file readable only by you:
cat > ~/code-workspace.env <<'EOF'PASSWORD=replace-with-a-long-random-passwordEOFchmod 600 ~/code-workspace.env
Start the container and bind the port to the loopback address only:
docker run -d \--name code-workspace \-p 127.0.0.1:8080:8080 \-v "$HOME/workspace:/home/coder/project" \--env-file ~/code-workspace.env \--restart unless-stopped \codercom/code-server:latest
A few notes. codercom/code-server is the official code-server image. For production, replace latest with a pinned version from Docker Hub to avoid behavior changes from automatic upgrades. PASSWORD is the login password for the editor; changing it requires deleting and recreating the container to take effect. --restart unless-stopped lets the container recover automatically after a server reboot. Since the port is bound only to 127.0.0.1, Docker won’t expose it to the public internet.
4.3 Configure the Access Channel
The goal is to let your local browser reach the workbench without exposing the port to the public internet. Two options:
Option 1: Tailscale with tailscale serve (recommended). Install Tailscale on both the server and your local machine, logging into the same account:
# On the servercurl -fsSL https://tailscale.com/install.sh | shsudo tailscale up
After installing the Tailscale client on your local machine and logging into the same account, run this on the server:
sudo tailscale serve --bg 8080
This command forwards HTTPS requests within the tailnet to the server’s 127.0.0.1:8080. On first use, you need to enable HTTPS certificates in the Tailscale admin console—the command output will show a prompt. Once configured, run sudo tailscale serve status to see the access URL, then open it in your local browser. Do not use tailscale funnel—it exposes the service to the public internet.
Option 2: SSH port forwarding (alternative). Run the following on your local machine and keep it running:
ssh -N -L 8080:127.0.0.1:8080 username@server-address
Then access http://127.0.0.1:8080 in your local browser. This doesn’t depend on Tailscale, but requires the server to expose an SSH port with SSH key authentication configured.
For the server firewall, only allow necessary ports. Allow SSH first before enabling the firewall to avoid locking yourself out:
sudo ufw allow OpenSSHsudo ufw default deny incomingsudo ufw enable
In the Tailscale admin console, you can also use ACLs to restrict access so only your own devices can reach the server’s port 443.
4.4 Install the AI Coding Extension
Open the editor via the access URL from the previous step and search the extension panel for the tool’s official extension name. Verify three things before installing:
- Whether the publisher is the tool’s official account;
- Whether the extension documentation states support for web-based editors or code-server;
- Whether the version number matches the extension description.
Complete the account login authorization as prompted. If the extension depends on additional command-line programs, install them per its official documentation.
5. Stability and Compliance Tips
- Keep the server and egress fixed. Frequently switching regions or egress nodes increases login environment changes, and the platform may require re-verification. Sticking with one server long-term reduces this friction. That said, this doesn’t guarantee your account won’t be affected—risk assessment is the platform’s call.
- Follow terms of service and usage rules. The tool’s terms of service, regional policies, and usage limits take precedence over anything in this article. Use your own account; don’t share or transfer it. Avoid large volumes of parallel calls in short bursts—use it at a normal pace.
- Don’t expose the workbench to the public internet. The editor can run terminal commands, which equates to operating the server. Keep the port bound to localhost only, and access it solely through Tailscale or SSH.
- Confirm critical operations one by one. The extension shows a confirmation panel before executing commands—approve important operations individually. Use Git to manage AI-generated changes so every modification is revertible.
- Back up regularly and take snapshots. Back up the
~/workspacedirectory.~/code-workspace.envcontains the login password, so encrypt it when backing up. Snapshot the server so you can rebuild quickly if something goes wrong. - Assess data sensitivity. Project code passes through the cloud server and may be sent to model services. When handling customer data, secrets, or regulated information, verify the relevant policies and internal rules first.
6. Troubleshooting
If the page won’t load, check in this order:
- Is the container running:
docker ps --filter name=code-workspace - Check container logs:
docker logs --tail 100 code-workspace - Confirm the port is listening:
ss -tlnp | grep 8080 - Test local access on the server:
curl -I http://127.0.0.1:8080
If access via Tailscale fails, check:
- Run
sudo tailscale statusto confirm both devices are online; - Run
sudo tailscale serve statusto confirm the forwarding configuration exists; - Check whether the ACL in the admin console allows your local device.
If you keep getting bounced back to the login page after logging in, first check whether the PASSWORD in ~/code-workspace.env has been changed. After changing it, you must delete the old container, re-run docker run, and clear your browser cookies before retrying.
If the project directory isn’t writable, run ls -ln ~/workspace to check ownership. If the owner isn’t UID 1000, fix it with sudo chown -R 1000:1000 ~/workspace.
If the extension won’t install or misbehaves, confirm it’s available on the Open VSX marketplace or that its documentation provides code-server installation instructions. In the editor’s output panel, switch to the extension’s output channel to view its logs. Container logs and extension logs need to be investigated separately.
7. Summary
The core idea of this setup is separating the execution environment from the access point. Your local machine becomes a terminal for display and input, while the tools run on a fixed server with centralized logs and project data. The trade-off is the cost of deploying and maintaining an extra server, in exchange for a controllable environment, inspectable logs, and centralized data management. It doesn’t replace compliance with terms of service, nor does it guarantee your account won’t be affected by platform decisions. If you’re also troubled by environment instability, use this architecture as a reference and adjust the details to fit your own network, security, and compliance requirements.
