{"id":22900533,"url":"https://github.com/rioastamal/installer-vscode-for-web","last_synced_at":"2025-08-30T09:16:06.626Z","repository":{"id":200616606,"uuid":"704816477","full_name":"rioastamal/installer-vscode-for-web","owner":"rioastamal","description":"Turn your fresh cloud VM into fully functional VS Code for the web with HTTPS enabled.","archived":false,"fork":false,"pushed_at":"2024-12-07T09:45:43.000Z","size":97,"stargazers_count":48,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T16:13:00.250Z","etag":null,"topics":["bash","caddy","cloud","cloud-ide","code-server","shell","vscode","vscode-remote"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rioastamal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-14T07:14:05.000Z","updated_at":"2025-01-26T20:38:50.000Z","dependencies_parsed_at":"2024-12-02T01:30:51.667Z","dependency_job_id":null,"html_url":"https://github.com/rioastamal/installer-vscode-for-web","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"d3137725d7d7a7bd1b6577dcfbe98fe0a6fb1845"},"previous_names":["rioastamal/installer-vscode-for-web"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Finstaller-vscode-for-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Finstaller-vscode-for-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Finstaller-vscode-for-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Finstaller-vscode-for-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rioastamal","download_url":"https://codeload.github.com/rioastamal/installer-vscode-for-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252979974,"owners_count":21835141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","caddy","cloud","cloud-ide","code-server","shell","vscode","vscode-remote"],"created_at":"2024-12-14T01:28:40.694Z","updated_at":"2025-05-08T01:24:50.899Z","avatar_url":"https://github.com/rioastamal.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Installer VS Code for the web\n\nTurn your fresh cloud VM into fully functional VS Code for the web with HTTPS enabled. You can work from any device as long as it supports a modern web browser.\n\n[![VS Code for the web](https://github-production-user-asset-6210df.s3.amazonaws.com/469847/275779903-a1b52a3a-6dd7-4b6a-a754-3071fb662ac5.jpg)](https://github-production-user-asset-6210df.s3.amazonaws.com/469847/275777169-60a3fe97-3296-479a-a772-4c0649ff794b.png)\n\n### Pre installation\n\nBefore running the installation commands make sure to allow inbound connections on port 80 (HTTP) and 443 (HTTPS) via your cloud virtual firewal configuration and your OS level firewall.\n\n### Installation\n\n```sh\nexport CODE_DOMAIN_NAME=vscode.example.com\nexport CODE_PASSWORD=MyVeryLongPassword123\n```\n\nThe `CODE_PASSWORD` environment variable is optional. If you omit it, a random password will be generated.\n\n```sh\ncurl -s -L https://raw.githubusercontent.com/rioastamal/installer-vscode-for-web/main/install.sh | bash -s -- --core\n```\n\nCommand above will automatically install and configure following software packages to turn your cloud VM into Cloud IDE:\n\n- [code-server](https://github.com/coder/code-server)\n- [Caddy](https://caddyserver.com/)\n\nOnce the installation is complete you can access your VS Code via HTTPS URL, e.g: `https://vscode.example.com`. To view the password, you can check `home/vscode/.config/code-server/config.yaml` on host machine.\n\n```sh\ncat /home/vscode/.config/code-server/config.yaml\n```\n\n### Table of contents\n\n- [Supported Linux distributions](#supported-linux-distributions)\n- [Development packages](#development-packages)\n- [Domain name for testing](#domain-name-for-testing)\n- [How to change the password?](#how-to-change-the-password)\n- [Login with Google and GitHub](#login-with-google-and-github)\n- [Roadmap](#roadmap)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Supported Linux distributions\n\nSupported Linux distributions:\n\n- AlmaLinux 9\n- Amazon Linux 2023\n- CentOS Stream 9 \n- CentOS Stream 8\n- Debian 12\n- Debian 11\n- Debian 10\n- RHEL 9\n- RockyLinux 9\n- Ubuntu 24.04 LTS\n- Ubuntu 22.04 LTS\n- Ubuntu 20.04 LTS\n\nThe list of supported Linux distributions can be expanded by emulating the OS version via the `EMULATE_OS_VERSION` environment variable. You should set this environment variable before running the installation script.\n\n- AlmaLinux 8 (use `export EMULATE_OS_VERSION=centos_8`)\n- RockyLinux 8 (use `export EMULATE_OS_VERSION=centos_8`)\n\n## Development packages\n\nThe installer provides with optional, ready to use development packages for modern application development.\n\nPackage | CLI option\n--------|-----------\nAll packages | `--dev-utils`\nAWS CLI v2 | `--awscli`\nBun (Javascript/TypeScript runtime) | `--bunjs`\nDocker | `--docker`\nGit | Automatically installed\nGo | `--go`\nJava (JDK) | `--jdk`\nnvm | `--nvm`\nNode (via nvm) | Installed via `--nvm`\nTerraform | `--terraform`\nServerless Framework | `--sls`\nMiniconda | `--miniconda`\n\nAll your development activities on VS Code should take place inside the `/home/vscode` directory.\n\nTo install development packages above on your VS Code terminal, run the installer command with the `--dev-utils` option.\n\n\u003e **Note**: If you're emulating OS version, don't forget to set `EMULATE_OS_VERSION` before running the command.\n\n```sh\ncurl -s -L https://raw.githubusercontent.com/rioastamal/installer-vscode-for-web/main/install.sh | bash -s -- --dev-utils\n```\n\nIf you prefer to install only one of these packages, such as Java, run command below:\n\n```sh\ncurl -s -L https://raw.githubusercontent.com/rioastamal/installer-vscode-for-web/main/install.sh | bash -s -- --jdk\n```\n\nMake sure to run these commands to apply all the changes to the current shell without having to log out:\n\n```sh\nsource $HOME/.bashrc\nnewgrp docker\n```\n\n## Domain name for testing\n\nIf you do not have domain name for testing, you can use free DNS service mapping like [nip.io](https://nip.io) which can map your VM's public IP address into domain name.\n\nAs an example, if your VM's public IP is `1.2.3.4` you can use following to map domain `1.2.3.4.nip.io` to your public IP.\n\n```sh\nexport CODE_DOMAIN_NAME=\"$( curl -s https://api.ipify.org ).nip.io\"\ncurl -s -L https://raw.githubusercontent.com/rioastamal/installer-vscode-for-web/main/install.sh | bash -s -- --core\n```\n\nNow your VS Code should be available at `https://1.2.3.4.nip.io`.\n\n\u003e **Important**: I recommend using your own domain name for real-world use cases. Use free DNS mapping services like these for testing purposes only.\n\n## How to change the password?\n\nTo change your VS Code password, edit a config file located at `/home/vscode/.config/code-server/config.yaml`.\n\n```\nbind-addr: 127.0.0.1:8080\nauth: password\npassword: YOUR_NEW_PASSWORD_HERE\ncert: false\n```\n\nSave the file and restart the code-server.\n\n```\nsudo systemctl restart code-server@vscode\n```\n\n## Login with Google and GitHub\n\n![Login via Google and GitHub](https://github.com/user-attachments/assets/b98d0e55-fdbd-459c-bc1e-537c938a6557)\n\nAs of v1.2, the installer supports OAuth2 login via Google and GitHub. To activate:\n\n1. Create OAuth applications on Google and GitHub:\n   - [Setting up OAuth 2.0 on Google](https://support.google.com/cloud/answer/6158849?hl=en)\n     - Authorized JavaScript origins: `https://DOMAIN_NAME`\n     - Authorized redirect URIs: `https://DOMAIN_NAME/__/oauth2/google/authorization-code-callback`\n   - [Creating OAuth app on GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)\n     - Homepage URL: `https://DOMAIN_NAME`\n     - Authorization callback URL: `https://DOMAIN_NAME/__/oauth2/github/authorization-code-callback`\n\n2. Modify OAuth settings in `/home/caddy/.config/caddy/Caddyfile.env`:\n\n   ```sh\n   sudo -u caddy vim /home/caddy/.config/caddy/Caddyfile.env\n   ```\n\n3. Configure Google login:\n\n   ```sh\n   sudo -u caddy vim /home/caddy/.config/caddy/oauth2/users/google.conf\n   ```\n\n   Add authorized email addresses:\n\n   ```\n   transform user {\n     match realm google\n     # Replace the email with yours\n     match email example@gmail.com john@example.com\n     action add role authp/user\n   }\n   ```\n\n4. Configure GitHub login:\n\n   ```sh\n   sudo -u caddy vim /home/caddy/.config/caddy/oauth2/users/github.conf\n   ```\n\n   Add authorized GitHub usernames:\n\n   ```\n   transform user {\n     match realm github\n     # Replace with your GitHub username\n     match sub github.com/johndoe\n     action add role authp/user\n   }\n   ```\n\n5. Update Caddy configuration:\n\n   ```\n   sudo -u caddy ln -fs /home/caddy/.config/caddy/Caddyfile.oauth2 /home/caddy/.config/caddy/Caddyfile\n   ```\n\n6. Disable code-server password authentication:\n\n   ```sh\n   sudo -u vscode vim /home/vscode/.config/code-server/config.yaml\n   ```\n\n   Change the `auth` and remove the `password`.\n\n   ```\n   bind-addr: 127.0.0.1:8080\n   cert: false\n   auth: none\n   password:\n   ```\n\n7. Restart services\n\n   ```sh\n   sudo systemctl restart caddy\n   sudo systemctl restart code-server@vscode\n   ```\n\nTo log out from OAuth2 session, visit: https://DOMAIN_NAME/__/logout\n\n## Roadmap\n\nRoadmap for future version:\n\n- [x] ~~GitHub authentication to access VS Code~~\n- [ ] Access local USB device from the VM\n\n## Changelog\n\n#### v1.2.1 (2024-12-07)\n\n- Support for both HTTP and HTTPS now available; previously, only HTTPS was supported.\n\nUse `CADDY_DISABLE_HTTPS=yes` before running the installer.\n\n#### v1.2 (2024-12-06)\n\n- Implemented OAuth2 login with Google and GitHub\n- Removed install_pip\n- Added Miniconda as a new developer tool\n- Updated various developer tool packages to their latest versions\n- Replaced Caddy binary with one from github.com/rioastamal/caddy-plus-security\n- Added support for Ubuntu 24.04\n\n#### v1.1.2 (2024-03-28)\n\n- Bug fix: Failed to detect OS version\n\n#### v1.1.1 (2023-10-26)\n\n- Bug fix: Unable to install code-server when $HOME variable is not present\n\n#### v1.1 (2023-10-23)\n\n- Ability to emulate OS version via `EMULATE_OS_VERSION`\n- A dedicated user `vscode`, is used for running VS Code.\n- Remove docker dependencies for running code-server and Caddy. VS Code terminal now run natively on host machine.\n- Remove Amazon Linux 2, CentOS 7, and Ubuntu 18.04 from the list of supported Linux distributions due to GLIBC version compatibility issues.\n\n#### v1.0 (2023-10-18)\n\n- Initial public release\n\n## Contributing\n\nFork this repo and send me a PR.\n\n## License\n\nThis project is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioastamal%2Finstaller-vscode-for-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frioastamal%2Finstaller-vscode-for-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioastamal%2Finstaller-vscode-for-web/lists"}