Expose a code-server instance over ngrok
Project description
VS Server Colab
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
- Install the package from PyPI:
pip install vs-server-colab
-
Configure ngrok (obtain your auth token at https://dashboard.ngrok.com/get-started/your-authtoken).
-
Run the setup (this runs the bundled install scripts in
src/):
# setup (runs install scripts under src/)
vscolab setup
- Start the server (a free port will be chosen automatically; provide your ngrok auth token):
vscolab start --auth-token YOUR_NGROK_TOKEN
- 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 tovscolab.logandngrok.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) andngrok.logby 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vs_server_colab-1.1.2.tar.gz.
File metadata
- Download URL: vs_server_colab-1.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a64722cbe8e7e887b78d7b6c85800d055ddb01e0b6be6577cf42a8031e3d5a8
|
|
| MD5 |
51c943a0d202c750b1920ffc3c5c7874
|
|
| BLAKE2b-256 |
efa15c1b5892c51762a19e387ef5f491bbf4d1532fc9a920083276d4d23d8603
|
File details
Details for the file vs_server_colab-1.1.2-py3-none-any.whl.
File metadata
- Download URL: vs_server_colab-1.1.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ef02c61072f03b60e6a79a2d5463ab5dc14a1266c9a47d13ca3a1bb28c7915
|
|
| MD5 |
b55d92082aadaf6291587adaeaa2d65b
|
|
| BLAKE2b-256 |
fefbd70feb7782f359e6723753ac40c1c77692bc94f84c8ea59f6c7dc36f3a12
|