Skip to main content

Expose a code-server instance over ngrok

Project description

VS Server Colab

VSCode Colab LinkedIn

VS Server Colab provides a lightweight workflow to run a headless VS Code (code-server) inside environments such as Google Colab and expose it securely via ngrok. It streamlines installation, launching, and teardown so you can use Colab like a remote VS Code instance.

Key features

  • Run VS Code (code-server) in cloud environments such as Colab.
  • Expose the server securely with ngrok and support for auth tokens.
  • Simple commands for install/setup, start, and teardown.
  • Logs written to files for debugging and long-running sessions.

Prerequisites

  • Python 3.6+ (for package installation and CLI).
  • A working internet connection.
  • A free or paid ngrok account (recommended) if you want persistent tunnels. Create an account at https://ngrok.com and add your auth token.

Quickstart

  1. Install the package from PyPI:
pip install vs-server-colab
  1. Configure ngrok (obtain your auth token at https://dashboard.ngrok.com/get-started/your-authtoken).

  2. Run the setup (this runs the bundled install scripts in src/):

# setup (runs install scripts under src/)
vscolab setup
  1. Start the server (a free port will be chosen automatically; provide your ngrok auth token):
vscolab start --auth-token YOUR_NGROK_TOKEN
  1. When finished, teardown and remove installed artifacts:
vscolab teardown

Usage examples and flags

  • vscolab setup — Run the installation scripts for code-server and ngrok.
  • vscolab start --auth-token <TOKEN> — Start code-server and ngrok tunnel (writes logs to vscolab.log and ngrok.log).
  • vscolab start --silent — Start ngrok in silent background mode.
  • vscolab teardown — Remove installed binaries and perform cleanup.

Notes and best practices

  • The package tries to pick an available port automatically. If you need a specific port, modify the code or start the server manually.
  • Logs are written to vscolab.log (code-server) and ngrok.log by default. Inspect these when troubleshooting.
  • Teardown currently removes installed binaries; it does not forcibly kill running processes by PID. If you need safer cleanup, consider adding PID files or system service integration.

Contributing

Contributions, issues and feature requests are welcome. Please open a GitHub issue or submit a pull request.

Connect

LinkedIn: Hasinthaka Piyumal

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vs_server_colab-1.1.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vs_server_colab-1.1.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file vs_server_colab-1.1.3.tar.gz.

File metadata

  • Download URL: vs_server_colab-1.1.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vs_server_colab-1.1.3.tar.gz
Algorithm Hash digest
SHA256 cde9377e34790214096c1f23dae61ca786b7ecfd8f081e8032b1adb07027f00d
MD5 69740e55af3d16ca05dc2183ced693ce
BLAKE2b-256 7d81cc00714eef68222a0f716a17787963e040bc0ac66d4cd16cbb056f9f0919

See more details on using hashes here.

File details

Details for the file vs_server_colab-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for vs_server_colab-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0be23e27963663dbdd618e4246411223a78551980b7d6d998d9ef242a085e1d
MD5 9cfd5b0f1b2b01a56631ae889983a94f
BLAKE2b-256 eb2e68a2f4498cd2b03a9aa490ddb2cb8208b684ef79fca88b4dbdfe0edbe982

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page