Sign inSign up

omairsalman/code-server-android

By omairsalman

Updated 4 months ago

VS Code in the browser with Android SDK 34/36, Build Tools, NDK r27 LTS, and Node.js LTS.

Image
1

1.9K

omairsalman/code-server-android repository overview

code-server-android

VS Code in the browser, pre-loaded with everything you need for Android mobile development.

Built on top of codercom/code-server, this image adds the Android SDK, NDK, build tools, and Node.js LTS so you can write, build, and export APKs entirely from a browser — on any machine, from anywhere.


What's Included

ComponentVersion
code-server (VS Code in browser)latest
Java (OpenJDK)21
Android SDK Platform34, 36
Android Build Tools34.0.0, 35.0.0
Android Platform Toolslatest
Android NDKr27 LTS (27.0.12077973)
Node.jsLTS (via NVM)
npm / npxbundled with Node

All Android SDK licenses are pre-accepted.


Quick Start

docker run -d \
  --name code-server-android \
  -p 8080:8080 \
  -v "$HOME/projects:/home/coder/projects" \
  -e PASSWORD=yourpassword \
  omairsalman/code-server-android:latest

Then open http://localhost:8080 in your browser and enter your password.

With Docker Compose
services:
  code-server-android:
    image: omairsalman/code-server-android:latest
    container_name: code-server-android
    ports:
      - "8080:8080"
    volumes:
      - ./projects:/home/coder/projects
      - code-server-config:/home/coder/.config
    environment:
      - PASSWORD=yourpassword
    restart: unless-stopped

volumes:
  code-server-config:

Recommendations

Use Host Networking

Since this is a full IDE, you'll inevitably run development servers — Vite, Angular CLI, Metro, Gradle dev builds, etc. — on various ports as you work across projects. If the container is on a Docker bridge network, those ports are only reachable inside the container unless you explicitly published them at startup, which means you'd have to recreate the container every time you need a new one.

Running on the host network sidesteps this entirely — any port your dev server opens is immediately accessible on the host, just as if you'd run it natively.

docker run -d \
  --restart unless-stopped \
  --name code-server-android \
  --network host \
  -v "$HOME/projects:/home/coder/projects" \
  -v "$HOME/.config/code-server:/home/coder/.config" \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  omairsalman/code-server-android:latest \
  --bind-addr 0.0.0.0:8080

Change 8080 in --bind-addr to any port you want the IDE accessible on. This is especially useful when running multiple instances of code-server on the same host for different users — just give each one a different port.

Use the Microsoft Extensions Marketplace

code-server ships with the Open VSX marketplace by default, which has a decent selection but is missing many extensions — particularly proprietary ones from Microsoft like the C# Dev Kit, some language packs, and various vendor-specific tools.

To switch to the full Microsoft marketplace, pass this environment variable:

-e 'EXTENSIONS_GALLERY={"serviceUrl":"https://marketplace.visualstudio.com/_apis/public/gallery","cacheUrl":"https://vscode.blob.core.windows.net/gallery/index","itemUrl":"https://marketplace.visualstudio.com/items","controlUrl":"","recommendationsUrl":""}'

Full example combining both recommendations:

docker run -d \
  --restart unless-stopped \
  --name code-server-android \
  --network host \
  -v "$HOME/projects:/home/coder/projects" \
  -v "$HOME/.config/code-server:/home/coder/.config" \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  -e 'EXTENSIONS_GALLERY={"serviceUrl":"https://marketplace.visualstudio.com/_apis/public/gallery","cacheUrl":"https://vscode.blob.core.windows.net/gallery/index","itemUrl":"https://marketplace.visualstudio.com/items","controlUrl":"","recommendationsUrl":""}' \
  omairsalman/code-server-android:latest \
  --bind-addr 0.0.0.0:8080

Note: Using the Microsoft marketplace from a non-Microsoft build of VS Code may conflict with Microsoft's terms of service. Use at your own discretion.


Environment Variables

VariableDescription
PASSWORDPassword to access the code-server UI
SUDO_PASSWORDOptional: enables sudo access inside the container
ANDROID_HOME/opt/android-sdk (pre-set)
ANDROID_NDK_HOME/opt/android-sdk/ndk/27.0.12077973 (pre-set)
JAVA_HOME/usr/lib/jvm/java-21-openjdk-amd64 (pre-set)
NVM_DIR/home/coder/.nvm (pre-set)

Persisting Data

Mount volumes for anything you want to survive container restarts:

-v "$HOME/projects:/home/coder/projects"      # your source code
-v "$HOME/.config/code-server:/home/coder/.config"  # VS Code settings & extensions
-v "$HOME/android-builds:/home/coder/android-builds" # build output

Ionic / Capacitor Example

Once inside the terminal in the browser:

# Install Ionic CLI globally
npm install -g @ionic/cli

# Create a new project
ionic start myApp tabs --type=angular

# Add Android platform
cd myApp
ionic capacitor add android

# Build and export a debug APK
ionic build
ionic capacitor sync android
cd android && ./gradlew assembleDebug

The resulting APK will be at android/app/build/outputs/apk/debug/app-debug.apk.


Accessing from Outside Your Local Network

This image works great with a reverse proxy + authentication layer. Recommended setup:

  • Nginx Proxy Manager or Caddy for HTTPS termination
  • Tailscale for secure remote access without exposing ports publicly
  • Authelia in front of the service for SSO if self-hosting multiple tools

Example Nginx Proxy Manager proxy host config:

  • Forward Hostname: 127.0.0.1 (when using host networking)
  • Forward Port: whichever port you passed to --bind-addr
  • Enable WebSocket support (required for VS Code to function)

Notes

  • Image size: Expect ~10.5 GB. The Android SDK, NDK, and base image together are substantial. Make sure you have enough disk space before pulling.
  • Architecture: linux/amd64 only. ARM builds (e.g. Raspberry Pi, Apple Silicon emulation) are not supported due to Android SDK constraints.
  • NDK: Includes r27 LTS (27.0.12077973), which is the version required by most Capacitor plugins. If your project requires a different NDK version, you can install it at runtime with sdkmanager "ndk;<version>" — licenses are pre-accepted.
  • Node version switching: NVM is installed and available in the terminal. Use nvm install <version> and nvm use <version> to switch as needed.

Tags

TagDescription
latestTracks the most recent build
1.0.0Initial stable release

Source

Dockerfile:

FROM codercom/code-server:latest

USER root

# ── System dependencies ───────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
    openjdk-21-jdk \
    unzip \
    wget \
    curl \
    && rm -rf /var/lib/apt/lists/*

# ── Android SDK ───────────────────────────────────────────────────────────
ENV ANDROID_HOME=/opt/android-sdk
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator

RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
    wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \
         -O /tmp/cmdtools.zip && \
    unzip -q /tmp/cmdtools.zip -d /tmp/cmdtools && \
    mkdir -p $ANDROID_HOME/cmdline-tools/latest && \
    mv /tmp/cmdtools/cmdline-tools/* $ANDROID_HOME/cmdline-tools/latest/ && \
    rm -rf /tmp/cmdtools /tmp/cmdtools.zip

RUN yes | sdkmanager --licenses && \
    sdkmanager \
        "platform-tools" \
        "platforms;android-34" \
        "platforms;android-36" \
        "build-tools;34.0.0" \
        "build-tools;35.0.0" \
        "ndk;27.0.12077973"

ENV ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ENV PATH=$PATH:$ANDROID_NDK_HOME

RUN chown -R coder:coder $ANDROID_HOME

# ── NVM + Node (as coder user) ────────────────────────────────────────────
USER coder
ENV NVM_DIR=/home/coder/.nvm
SHELL ["/bin/bash", "-c"]

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \
    source $NVM_DIR/nvm.sh && \
    nvm install --lts && \
    nvm alias default 'lts/*' && \
    nvm use default

Tag summary

Content type

Image

Digest

sha256:b4c5817cc

Size

2.6 GB

Last updated

4 months ago

docker pull omairsalman/code-server-android