Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ VS Code in Termux β€” Complete Setup Guide (2026)

Run a fully functional VS Code development environment on Android β€” no PC required.

Skynet Project Platform Editor License Version


πŸ”— Check out our new project: github.com/skynetfc/Atlantia-Empire


πŸ“‹ Table of Contents


🎯 Overview

This guide provides a complete, production-ready setup for running VS Code inside Termux on Android devices. Whether you're coding on the go, learning new languages, or building full-stack applications β€” this setup delivers a professional-grade development experience directly from your mobile device.

Target: Android 10+ | Termux 0.118+ | Code-Server 4.x


πŸ’» System Requirements

Storage

Component Minimum Recommended
Termux Base 200 MB 500 MB
Code-Server 500 MB 1.0 GB
Node.js Runtime 100 MB 200 MB
Python Environment 50 MB 100 MB
Build Toolchain 300 MB 500 MB
VS Code Extensions 100 MB 300 MB
Project Workspace 500 MB 2.0 GB
Total ~1.75 GB ~4.6 GB

⚠️ Recommendation: Maintain at least 5 GB of free storage for optimal performance and future expansion.

Hardware

Specification Minimum Recommended
RAM 3 GB 6 GB+
Android Version 10 (API 29) 13+ (API 33+)
Processor ARM64 ARM64 (8-core)
Free Storage 3 GB 5 GB

πŸ“¦ Prerequisites

  1. Install Termux from F-Droid

    ⚠️ Do not use the Google Play Store version β€” it is outdated and no longer maintained.

  2. Install Termux:API (optional, recommended for extended functionality)

    • Available on F-Droid alongside Termux

πŸ”§ Installation

Step 1: Update Termux Packages

Ensure your package index and installed packages are current:

pkg update && pkg upgrade -y

πŸ’Ύ Storage impact: ~50–100 MB


Step 2: Install Dependencies

Install the core toolchain required for development:

pkg install -y nodejs python git wget curl build-essential

πŸ’Ύ Storage impact: ~400–600 MB

Installed components:

  • nodejs β€” JavaScript runtime & npm
  • python β€” Python 3 interpreter & pip
  • git β€” Version control
  • wget / curl β€” Network utilities
  • build-essential β€” GCC, make, and compilation tools

Step 3: Install Code-Server

Code-Server is the official open-source VS Code distribution for remote development, running entirely in the browser.

Method A: npm (Recommended)

npm install -g code-server

Method B: Official Installer Script

curl -fsSL https://code-server.dev/install.sh | sh

πŸ’Ύ Storage impact: ~500 MB – 1.0 GB


Step 4: Configure Code-Server

Create the configuration directory and file:

mkdir -p ~/.config/code-server
cat > ~/.config/code-server/config.yaml << 'EOF'
bind-addr: 127.0.0.1:8080
auth: password
password: CHANGE_THIS_TO_A_STRONG_PASSWORD
cert: false
EOF

πŸ” Security: Replace CHANGE_THIS_TO_A_STRONG_PASSWORD with a cryptographically strong password (16+ characters, mixed case, numbers, symbols).

Configuration reference:

Key Value Description
bind-addr 127.0.0.1:8080 Localhost binding (secure default)
auth password Password-based authentication
password <your_password> Access credential
cert false TLS disabled (use reverse proxy for HTTPS)

Step 5: Start Code-Server

Launch the server:

code-server

Expected output:

[2026-07-09T10:00:00.000Z] info  code-server 4.95.3
[2026-07-09T10:00:00.000Z] info  Using config file ~/.config/code-server/config.yaml
[2026-07-09T10:00:00.000Z] info  HTTP server listening on http://127.0.0.1:8080/
[2026-07-09T10:00:00.000Z] info  Session server listening on ~/.local/share/code-server/code-server-ipc.sock

Step 6: Access VS Code

  1. Open your preferred browser (Chrome, Firefox, Brave, etc.)
  2. Navigate to: http://127.0.0.1:8080
  3. Enter your configured password
  4. βœ… VS Code is now running on your Android device

🧩 Extensions

Install the following essential extensions via the Extensions panel (Ctrl+Shift+X):

Extension Publisher Purpose
Python Microsoft Python language support, IntelliSense, debugging
ESLint Microsoft JavaScript/TypeScript linting
Prettier Prettier Code formatting
Live Server Ritwick Dey Local development server for web projects
C/C++ Microsoft C and C++ language support
Extension Pack for Java Microsoft Java development toolkit
GitLens GitKraken Enhanced Git visualization
Markdown All in One Yu Zhang Markdown authoring support

πŸ’Ύ Storage impact: ~10–50 MB per extension


πŸ› οΈ Development Environments

Python

pkg install python
pip install --upgrade pip

πŸ’Ύ Storage impact: ~50–100 MB

Verify installation:

python --version
pip --version

Node.js

Pre-installed with Step 2. Verify:

node --version   # v22.x.x
npm --version    # 10.x.x

C / C++

pkg install clang

πŸ’Ύ Storage impact: ~200–300 MB

Verify installation:

clang --version

Java

pkg install openjdk-21

πŸ’Ύ Storage impact: ~300–400 MB

Verify installation:

java --version
javac --version

Web Development

npm install -g live-server

πŸ’Ύ Storage impact: ~20–30 MB


πŸ”„ Background Operation

To maintain VS Code availability without keeping Termux in the foreground, use one of the following methods:

Method 1: nohup (Recommended)

Run code-server detached from the terminal:

nohup code-server > ~/code-server.log 2>&1 &

Stop the server:

pkill code-server

View logs:

tail -f ~/code-server.log

Method 2: Termux:Boot (Auto-start on Boot)

  1. Install Termux:Boot from F-Droid
  2. Create the boot directory:
    mkdir -p ~/.termux/boot
  3. Create the startup script:
    cat > ~/.termux/boot/start-code-server.sh << 'EOF'
    #!/data/data/com.termux/files/usr/bin/bash
    termux-wake-lock
    nohup code-server > ~/code-server.log 2>&1 &
    EOF
    chmod +x ~/.termux/boot/start-code-server.sh
  4. Reboot your device β€” code-server starts automatically

Method 3: tmux Session Management

pkg install tmux

Create and attach to a session:

tmux new -s vscode
code-server

Detach: Ctrl+B then D
Reattach: tmux attach -t vscode


Prevent Android from Killing Termux

  1. Android Settings β†’ Apps β†’ Termux β†’ Battery β†’ Unrestricted
  2. Disable battery optimization for Termux
  3. Acquire wake lock to keep CPU active:
    termux-wake-lock
  4. Release wake lock when done:
    termux-wake-unlock

βœ… Best Practice: Combine nohup + termux-wake-lock for maximum reliability.


🌍 External Access

To access VS Code from another device on the same local network:

  1. Identify your device's IP address:

    ifconfig

    Look for the wlan0 interface (e.g., 192.168.1.42).

  2. Update the binding address:

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

    Change:

    bind-addr: 0.0.0.0:8080
  3. Restart code-server

  4. Access from another device:

    http://YOUR_DEVICE_IP:8080
    

⚠️ Security Warning: Only expose code-server on trusted local networks. For remote access, use a VPN or SSH tunnel.


✨ Features

Capability Status Notes
Full VS Code Editor βœ… Supported All editing features, multi-cursor, Emmet
Integrated Terminal βœ… Supported Full bash/zsh access within editor
Git Integration βœ… Supported Clone, commit, push, pull, diff
Extensions Marketplace βœ… Supported Thousands of extensions available
Debugging βœ… Supported Python, Node.js, C++, Java
IntelliSense βœ… Supported Code completion, hover info, go-to-definition
File Explorer βœ… Supported Full filesystem navigation
Multi-language Support βœ… Supported 50+ programming languages
Remote Development βœ… Supported Access from any browser on the network
Themes & Customization βœ… Supported Full theme and settings sync

🎯 Example Projects

1. Flask Web Application

mkdir -p ~/projects/flask-demo
cd ~/projects/flask-demo
pip install flask

app.py:

from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/')
def index():
    return jsonify({
        "message": "Hello from Termux VS Code!",
        "platform": "Android",
        "runtime": "Flask + Python"
    })

@app.route('/health')
def health():
    return jsonify({"status": "healthy"})

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)

Run:

python app.py

2. Express.js REST API

mkdir -p ~/projects/express-demo
cd ~/projects/express-demo
npm init -y
npm install express

server.js:

const express = require('express');
const app = express();

app.use(express.json());

app.get('/', (req, res) => {
    res.json({
        message: 'Hello from Termux VS Code!',
        platform: 'Android',
        runtime: 'Node.js + Express'
    });
});

app.get('/health', (req, res) => {
    res.json({ status: 'healthy' });
});

app.listen(3000, '0.0.0.0', () => {
    console.log('πŸš€ Server running at http://0.0.0.0:3000');
});

Run:

node server.js

3. C++ Console Application

hello.cpp:

#include <iostream>
#include <string>

int main() {
    std::string platform = "Termux on Android";
    std::cout << "Hello from " << platform << "!" << std::endl;
    std::cout << "Compiled with Clang in VS Code." << std::endl;
    return 0;
}

Compile and run:

clang++ -std=c++17 -O2 hello.cpp -o hello
./hello

πŸ”§ Troubleshooting

Connection Refused / localhost unreachable

Check Command
Is code-server running? pgrep -f code-server
Correct port? cat ~/.config/code-server/config.yaml
Restart Termux Close all sessions and reopen
Restart code-server pkill code-server && code-server

Extension Installation Fails

Cause Solution
No internet connection Verify Wi-Fi / mobile data
ARM architecture limitation Check extension compatibility
Outdated code-server npm update -g code-server
Corrupted extension cache rm -rf ~/.local/share/code-server/extensions

Insufficient Storage

# Clean package cache
pkg clean

# Remove unused dependencies
pkg autoremove -y

# Check code-server disk usage
du -sh ~/.config/code-server ~/.local/share/code-server

# List largest packages
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -20

Code-Server Crashes or Freezes

Action Command
Check available RAM free -h
Kill all code-server processes pkill -9 code-server
Update all packages pkg update && pkg upgrade -y
Clear extension cache rm -rf ~/.local/share/code-server/CachedExtensionVSIXs
Restart with minimal extensions code-server --disable-extensions

⚑ Performance Optimization

  1. Limit Open Tabs β€” Keep only actively edited files open
  2. Disable Unused Extensions β€” Uninstall or disable extensions not in use
  3. Use Lightweight Themes β€” Prefer Dark+ or Light+ over heavy custom themes
  4. Manage Terminal Instances β€” Close integrated terminals when not needed
  5. Regular Maintenance β€” Run pkg clean weekly to reclaim space
  6. Enable File Exclusions β€” Add node_modules/, __pycache__/ to files.exclude
  7. Reduce Editor Font Size β€” Smaller fonts improve rendering performance on mobile

πŸ’Ύ Storage Integration

Grant Termux access to Android shared storage:

termux-setup-storage

Available mount points:

Path Description
~/storage/downloads Downloads folder
~/storage/dcim Camera photos & videos
~/storage/shared Internal storage root
~/storage/music Music directory
~/storage/movies Movies directory
~/storage/pictures Pictures directory

Sync projects with Git:

cd ~/projects/my-app
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/username/repo.git
git push -u origin main

πŸ”’ Security Best Practices

Practice Implementation
Strong Authentication Use 16+ character passwords with mixed entropy
Network Isolation Bind to 127.0.0.1 by default; avoid 0.0.0.0 on public networks
Encrypted Remote Access Use WireGuard or OpenVPN instead of direct exposure
Regular Updates pkg upgrade weekly to patch vulnerabilities
Minimal Permissions Grant only required Android permissions to Termux
Secret Management Never commit credentials; use .env files excluded from Git
Session Timeout Restart code-server after extended idle periods

πŸ“š Resources

Resource Link
Code-Server Documentation coder.com/docs/code-server
Termux Wiki wiki.termux.com
VS Code Docs code.visualstudio.com/docs
F-Droid Repository f-droid.org
Atlantia Empire Project github.com/skynetfc/Atlantia-Empire

🌟 Created by Skynet

GitHub Project


πŸ’‘ Note: This setup is ideal for mobile development, learning, prototyping, and lightweight production workloads. For resource-intensive tasks (large builds, heavy ML training), a dedicated workstation remains recommended.

If this guide helped you, please ⭐ star the repository!

About

Complete guide to installing VS Code in Termux on Android. No PC required! Includes setup for Python, Node.js, C++, Java, and web development. Transform your phone into a coding machine. πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors