Install code-server on Android using Termux and TUR. Run VS Code in a browser, access it over LAN, manage extensions, and understand Android limitations.

I was stuck on a twelve‑hour train journey with a tablet, a Bluetooth keyboard, and an urgent need to fix a production bug. My laptop was dead. In desperation, I opened Termux, typed a few commands, and twenty minutes later I was staring at a full VS Code interface – syntax highlighting, integrated terminal, file explorer and all – inside my tablet's browser. No root, no cloud VM, just Android and the open‑source magic of code‑server.

Turning an Android device into a portable coding workstation is entirely possible, and it's far simpler than most people think. By combining Termux with the official code‑server package from the Termux User Repository (TUR), you get a browser‑based VS Code environment that runs directly on your phone or tablet. In this guide I'll show you the most reliable installation method, how to configure network access, how to keep the server alive in the background, and the critical limitations you need to know about extensions and Android's filesystem.

This setup is especially useful if you have an Android tablet with a keyboard, a stable Wi‑Fi connection, and the desire to write code without lugging a laptop everywhere.

What You'll Need

  • An Android device running Android 7.0 or later (ARM64 processor).
  • Termux from F‑Droid (the Play Store version is outdated and lacks packages).
  • At least 1–2 GB of free storage for code‑server, extensions, and your projects.
  • A network connection for downloading packages and accessing the server from other devices.
  • Optional but highly recommended: a Bluetooth or USB keyboard and a mouse.

Step 1: Update Termux and Install Essential Tools

Launch Termux and bring the package list up to date:

pkg update && pkg upgrade -y

We'll also install git and python (useful for many workflows) right away:

pkg install git python -y

Step 2: Install code‑server from the Termux User Repository (TUR)

The code‑server project officially recommends using the Termux User Repository for a native, glibc‑free installation that avoids binary compatibility issues. This is far more reliable than manually downloading a Linux binary or using the generic install script.

First, add the TUR repository:

pkg install tur-repo -y

Then install code‑server:

pkg install code-server -y

Start the server to test it:

code-server

You'll see output confirming that the server is listening on http://127.0.0.1:8080 and a password (or a link to the config file where the password is stored).

Step 3: Open VS Code in Your Browser

code‑server is now running on your device. Open any browser (Chrome, Firefox, Kiwi) on the same Android device and navigate to:

http://127.0.0.1:8080

Alternatively, use http://localhost:8080. You'll be asked for the password stored in ~/.config/code-server/config.yaml. After login, the familiar VS Code interface appears, complete with the integrated terminal, file explorer, and extension marketplace.

Step 4: Configure LAN Access (Optional)

By default code‑server listens only on the local device. To use it from your laptop or another tablet on the same Wi‑Fi network, you must bind the server to a network interface.

Open the configuration file:

nano ~/.config/code-server/config.yaml

Adjust the bind-addr line to:

bind-addr: 0.0.0.0:8080

(You may also set a custom password and keep auth: password for security.)

Find your Android device's IP address – you can check Wi‑Fi settings or run ifconfig in Termux. If your IP is 192.168.1.100, you can now access VS Code from another device by visiting http://192.168.1.100:8080.

Security note: Binding to 0.0.0.0 makes the server accessible to anyone on the local network. Never expose this HTTP port directly to the internet. For remote access, use an encrypted solution like SSH port forwarding or a properly configured HTTPS reverse proxy (Caddy or Nginx with Let's Encrypt).

Step 5: Run code‑server in the Background with tmux

If you close Termux, the server stops. To keep it alive for longer sessions, use tmux:

pkg install tmux -y
tmux new -s vscode
code-server

Detach from the tmux session by pressing Ctrl+B, then D. The server continues running in the background. To return later, type:

tmux attach -t vscode

Keep in mind that Android may still kill long‑running background apps to save battery. Check your device's battery optimization settings and consider excluding Termux from power‑saving restrictions.

Step 6: Access Android Shared Storage

Termux lives inside its own private filesystem. To reach your photos, downloads, and documents, run:

termux-setup-storage

Grant the permission, and your shared storage becomes available at ~/storage/shared.

Critical limitation: The code‑server team explicitly warns that Git operations (clone, commit, push) can fail when working directly inside /sdcard (the Android shared storage mount). For any project that uses Git, keep the repository inside the Termux home directory (/data/data/com.termux/files/home) rather than under ~/storage/shared.

Step 7: Install VS Code Extensions – What Actually Works?

This is the most important reality check. The browser‑based VS Code interface works beautifully, but not every desktop extension will install or function correctly on Android.

Many extensions detect the platform as "Android" and refuse to install, even through the marketplace. The official documentation states that many extensions, including language packs, fail because Android is not treated as a supported platform.

You may have luck with extensions that are pure web/TypeScript (e.g., Prettier, GitLens, color themes) because they don't need native binaries. Extensions that rely on desktop toolchains (C++, Docker, some Python language servers) are much less likely to work out of the box.

If you have a .vsix file, you can try manual installation:

code-server --install-extension path/to/extension.vsix

This bypasses the marketplace check, but it does not guarantee the extension's native dependencies will run on Android.

Python Development

Python itself works perfectly in Termux:

pkg install python -y
python --version

However, the full Pylance language server experience may be degraded. You can still write and run Python scripts, but expect a lighter editing experience than on a real desktop.

Node.js Development

Node.js is fully functional:

pkg install nodejs-lts -y
node --version
npm --version

You can use the integrated terminal for everything Node‑related without issues.

Real‑World Performance and Limitations

  • It's a browser‑based IDE. You're not running native VS Code, but the experience is impressively close.
  • No root required. Everything runs in the Termux userspace.
  • Battery drain is noticeable. Running a Node.js server plus language tools can chew through battery; keep a charger handy.
  • Android background management can kill the process. Using tmux helps, but battery optimization may still interfere.
  • Extension compatibility is hit‑or‑miss. Treat your Android setup as a lightweight editor, not a full desktop IDE.
  • Large projects and heavy language servers may overwhelm mobile hardware.

Troubleshooting Common Issues

"code-server: command not found"

Ensure you installed the Termux package from TUR, not via npm or the generic install script. Verify with pkg list-installed | grep code-server. If missing, reinstall with pkg install code-server. Also check that your PATH includes ~/../usr/bin (it should by default).

Cannot open localhost:8080

Make sure code‑server is actually running (ps -ef | grep code-server). If it stopped, restart it. Some browsers block localhost for security; try 127.0.0.1:8080.

Cannot access from another device

  • Check that both devices are on the same network.
  • Verify the bind address in the config file is set to 0.0.0.0:8080 or your device's IP.
  • Ensure no firewall or "client isolation" setting on the Wi‑Fi router blocks the connection.

Git operations fail inside /sdcard

This is a documented limitation. Move your project to ~/ (inside Termux home) and Git will work normally.

An extension refuses to install or doesn't work

This is expected behavior. Android is not a supported platform for many extensions. You can try the VSIX manual install, but accept that some extensions will simply not function.

Alternative Installation: npm (Only If TUR Fails)

If the TUR package doesn't suit your setup, code‑server can also be installed via npm. This requires additional build tools:

pkg install build-essential binutils pkg-config python3 nodejs-lts npm -y
npm install --global code-server
code-server

However, the npm method is larger and may still encounter glibc issues. The TUR method is the official recommendation for Termux.

Key Takeaways

  • Use the Termux User Repository (TUR) method for a glitch‑free installation of code‑server on Android.
  • The resulting VS Code environment runs in your browser; no root, no cloud VM.
  • LAN access lets you code from any device on your home network.
  • Extension support is limited – treat your tablet as a powerful editor, not a full IDE.
  • Keep Git repositories inside the Termux home directory to avoid filesystem bugs.
  • Always use a secure tunnel (SSH or HTTPS) if you need remote access over the internet.

Frequently Asked Questions

Is code-server free?

Yes. code-server is an open-source project maintained by Coder. You can use it without any licensing fees.

Can I access code-server from my laptop?

Yes. Configure code-server to listen on a network interface (e.g., 0.0.0.0:8080) and open your Android device's IP address and port from the laptop. Only do this on a trusted local network.

Can I use this on an Android tablet?

Absolutely. A tablet with a Bluetooth keyboard provides an excellent form factor. Performance depends on your device's CPU and RAM, but for web development, scripting, and light projects it's very capable.

Does this work on ChromeOS?

If your Chromebook has the Linux development environment (Crostini), you can install code-server directly there. Termux is not required.

Can I expose code-server to the internet safely?

Never expose the raw HTTP port. Use SSH port forwarding (e.g., ssh -L 8080:localhost:8080 user@your-device) or set up a proper HTTPS reverse proxy with a domain and certificate.

Comments