Skip to content

Instantly share code, notes, and snippets.

@Amrinder-S
Forked from ppoffice/README.md
Last active October 24, 2023 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Amrinder-S/b9acb85966eb3b5e2e12693aa3e2992d to your computer and use it in GitHub Desktop.
Save Amrinder-S/b9acb85966eb3b5e2e12693aa3e2992d to your computer and use it in GitHub Desktop.
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
  3. Install code-server via apt or pkg

$ pkg install code-server

OR

apt install code-server

Run the server

$ cd ~
$ code-server --auth none --disable-telemetry
<img src="https://imgur.com/CxOgPvg.png" width="200">
  1. Now, you can open your browser and visit code-server at http://localhost:8080.

  2. (Bonus) If you wish to visit this code-server from another device in the same local network, you can expose the HTTP service to all network interfaces by starting code-server with --bind-addr:

    $ code-server --bind-addr 0.0.0.0:8080 --disable-telemetry

    You can find the password under ~/.config/code-server/config.yaml:

    $ cat ~/.config/code-server/config.yaml

    You may also need to enable HTTPS to enable clipboard and others features of Visual Studio Code in browsers. To do this, install openssl-tool and let code-server generate a certificate on startup:

    $ pkg install openssl-tool
    $ code-server --bind-addr 0.0.0.0:8080 --cert --disable-telemetry

    You can get the public IP address of your device using the command below in Termux:

    $ ifconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment