Skip to content

Commit 8b41448

Browse files
Mike Niklesjeanp413
Mike Nikles
authored andcommitted
Add more guides.
1 parent 32b67f0 commit 8b41448

File tree

8 files changed

+232
-0
lines changed

8 files changed

+232
-0
lines changed
File renamed without changes.

docs/guides/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# OpenVSCode Server Guides
2+
3+
In this directory, you find a non-exhaustive collection of deployment guides for OpenVSCode Server.
4+
5+
Each directory contains a `README.md` file as the main guide. Additional, supporting files may be available in any given directory where necessary.
6+
7+
## Add a new guide
8+
9+
We welcome community contributions 🙏. Please open an issue and/or pull request if you would like to add new deployment guides.
10+
11+
To add a new guide:
12+
1. Copy the `_template` directory and name it based on the deployment platform you write a guide for
13+
1. Update the `<new-deployment-platform>/README.md` file by completing the existing sections
14+
1. Open a pull request
15+
16+
For guidance & inspiration, please refer to existing guides.

docs/guides/_template/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Deploy OpenVSCode Server to [NEW-DEPLOYMENT-PLATFORM]
2+
3+
## Prerequisites
4+
5+
## Setup
6+
7+
## Start the server
8+
9+
## Access OpenVSCode Server
10+
11+
## Teardown

docs/guides/digital-ocean/README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Deploying an OpenVSCode Server to Digital Ocean
2+
3+
## Creating the Droplet
4+
5+
First, you need to create a Virtual Machine to host your server. If you don't have one already, you can start with [our template](https://cloud.digitalocean.com/droplets/new?use_case=droplet&i=59c3b0&fleetUuid=a8fdcc26-2bf0-449d-8113-e458327192fe&distro=ubuntu&distroImage=ubuntu-20-04-x64&size=s-1vcpu-1gb-amd&region=fra1&options=ipv6), then change a couple of settings as explained below.
6+
7+
- You either need to set a password or add an SSH key. For demonstration purposes, it's easier to use a password. **Caution**: This is for demo purposes, please follow security best practices for a production environment.
8+
- We need to do is to check the checkbox <kbd>User data</kbd> and add the following script to the text field below: **TODO: What script, cc @filiptronicek**
9+
10+
## Initial setup
11+
12+
- First things first, you need to turn on the Droplet by selecting it in the dashboard and toggling the switch on the top right of the page.
13+
- Then, you need to copy the Droplet's IP address, available on the same page in the top bar. If you are unsure whether to copy the **ipv4** or **ipv6** address, select **ipv4**.
14+
- Now you can connect to your droplet via SSH, which you can do straight from your terminal by executing the following commands (you will need to replace `DROPLET_IP` with the actual address you copied in the previous step):
15+
```
16+
ssh root@DROPLET_IP
17+
```
18+
- When prompted, enter the password you chose during the configuration.
19+
20+
### Downloading OpenVSCode Server
21+
22+
**Caution**: Make sure you successfully connected to the Droplet before you execute the following commands.
23+
24+
First, let's define the release version we want to download. You can find the latest version on the [Releases](https://github.com/gitpod-io/openvscode-server/releases) page.
25+
26+
```bash
27+
export SERVER_VERSION=1.60.0 # Replace with the latest version
28+
```
29+
30+
With that in place, let's download & extract OpenVSCode server:
31+
32+
```bash
33+
wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v$SERVER_VERSION/openvscode-server-v$SERVER_VERSION-linux-x64.tar.gz -O code-server.tar.gz
34+
tar -xzf code-server.tar.gz
35+
rm code-server.tar.gz
36+
```
37+
38+
While you are still connected to the VM, execute the following commands to start OpenVSCode Server:
39+
40+
```bash
41+
cd openvscode-server-v$SERVER_VERSION-linux-x64
42+
./server.sh
43+
```
44+
45+
> Gotcha: If you close the SSH session, the server will stop as well. To avoid this, you can run the server script in the background with the command shown below. If you want to do things like kill the process or bring it back to the foreground, refer to [Run a Linux Command in the Background](https://linuxize.com/post/how-to-run-linux-commands-in-background/#run-a-linux-command-in-the-background) or use a multiplexer such as [tmux](https://en.wikipedia.org/wiki/Tmux) [[tmux - a very simple beginner's guide](https://www.ocf.berkeley.edu/~ckuehl/tmux/)].
46+
```
47+
./server.sh >/dev/null 2>&1 &
48+
```
49+
50+
You're all set! You can now access your IDE at `http://<your-droplet-ip>:3000`.
51+
52+
## Further steps
53+
54+
### Running OpenVSCode Server on startup
55+
56+
If you want to run the server on boot, you can add this to your Crontab file (`crontab -e`):
57+
58+
```
59+
@reboot /root/openvscode-server-v<REPLACE_WITH_LATEST_VERSION>-linux-x64/server.sh
60+
```
61+
62+
Make sure you replace `REPLACE_WITH_LATEST_VERSION` with the version you used earlier.
63+
64+
### Adding a custom domain
65+
66+
You can follow the official [DNS Quickstart](https://docs.digitalocean.com/products/networking/dns/quickstart/) guide for setting up a custom domain with your Droplet.
67+
68+
### Securing the Droplet
69+
70+
There is an awesome video by Mason Egger called [Securing Your Droplet](https://youtu.be/L8e_eAm4fFM), which explains some key steps for hardening the security of the Droplet.

docs/guides/gcp-gce/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Deploy OpenVSCode Server to Google Cloud Platform - Compute Engine
2+
3+
## Prerequisites
4+
5+
To complete this guide, you need:
6+
* a GCP account
7+
* a project where you can create a virtual machine
8+
9+
## Start the interactive tutorial
10+
11+
This guide is available as an interactive Cloud Shell tutorial. To get started, please click the following button:
12+
13+
[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.png)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/gitpod-io/openvscode-server&cloudshell_tutorial=docs/guides/gcp-gce/cloud-shell-tutorial.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# How to set up OpenVSCode Server on GCE
2+
3+
## Welcome 👋!
4+
5+
In this tutorial, you are going to set up [OpenVSCode Server](https://github.com/gitpod-io/openvscode-server) on GCE.
6+
7+
**Time to complete**: Less than 10 minutes
8+
9+
Click the **Start** button to move to the next step.
10+
11+
## Enable required APIs
12+
13+
Click the button below to enable the APIs required to complete this tutorial.
14+
15+
<walkthrough-enable-apis apis="compute.googleapis.com"></walkthrough-enable-apis>
16+
17+
## Create a VM
18+
19+
Let's first create a virtual machine to host our server:
20+
21+
```bash
22+
gcloud beta compute instances create openvscode-server --machine-type=e2-micro --image=ubuntu-2004-focal-v20210908 --image-project=ubuntu-os-cloud --boot-disk-size=10GB --boot-disk-type=pd-balanced --boot-disk-device-name=openvscode-server --tags=http-openvscode-server
23+
```
24+
25+
**Tip**: Click the copy button on the side of the code box and paste the command in the Cloud Shell terminal to run it.
26+
27+
### Allow HTTP & HTTPS
28+
29+
To access OpenVSCode Server, we have to allow HTTP traffic on port 3000 to the server:
30+
31+
```bash
32+
gcloud compute firewall-rules create openvscode-server-allow-http-3000 --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:3000 --source-ranges=0.0.0.0/0 --target-tags=http-openvscode-server
33+
```
34+
35+
Next, you will ssh into the newly created VM to install OpenVSCode Server.
36+
37+
## Install OpenVSCode Server
38+
39+
### Connect to the VM
40+
41+
```bash
42+
gcloud beta compute ssh "openvscode-server" --project "dcs-openvscode-server"
43+
```
44+
45+
### Download OpenVSCode Server
46+
47+
**Caution**: Make sure you successfully connected to the `openvscode-server` VM before you execute the following commands. Your prompt should read: `your-name@openvscode-server:~$`
48+
49+
First, let's define the release version we want to download. You can find the latest version on the [Releases](https://github.com/gitpod-io/openvscode-server/releases) page.
50+
51+
```bash
52+
export SERVER_VERSION=1.60.0 # Replace with the latest version
53+
```
54+
55+
With that in place, let's download & extract OpenVSCode server:
56+
57+
```bash
58+
wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v$SERVER_VERSION/openvscode-server-v$SERVER_VERSION-linux-x64.tar.gz -O code-server.tar.gz
59+
tar -xzf code-server.tar.gz
60+
rm code-server.tar.gz
61+
```
62+
63+
### Execute the startup script
64+
65+
While you are still connected to the VM, execute the following command to start OpenVSCode Server:
66+
67+
```bash
68+
cd openvscode-server-v$SERVER_VERSION-linux-x64
69+
./server.sh
70+
```
71+
72+
**Note**: If you cancel the script, the OpenVSCode Server will stop.
73+
74+
Next up, you are going to access the shiny new OpenVSCode Server in your browser.
75+
76+
## Access OpenVSCode Server in your browser
77+
78+
Congratulations 🎉! Use the following command to access OpenVSCode Server in a new browser tab.
79+
80+
With the server still running, open a new Cloud Shell tab and execute the following command:
81+
82+
```bash
83+
export SERVER_IP=$(gcloud compute instances describe openvscode-server \
84+
--format='get(networkInterfaces[0].accessConfigs[0].natIP)')
85+
echo "http://$SERVER_IP:3000"
86+
```
87+
88+
Click the URL displayed in the terminal to see OpenVSCode Server up and running.

docs/guides/railway/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Deploying an OpenVSCode Server to Railway
2+
3+
To deploy to https://railway.app, all it takes is to click the following button:
4+
5+
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2Fgitpod-io%2Fopenvscode-releases&envs=RELEASE_TAG%2CPORT&RELEASE_TAGDefault=openvscode-server-v1.60.0&PORTDefault=3000)

docs/guides/render/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Deploying an OpenVSCode Server to Render
2+
3+
## Creating the server with one click
4+
5+
To host OpenVSCode Server on Render (www.render.com), click the button below:
6+
7+
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://dashboard.render.com/login?next=/iac/new?repo=https://github.com/render-examples/gitpod-vscode-example)
8+
9+
After that, create a name for the service group (for example `OpenVSCode Server`) and click <kbd>Apply</kbd>.
10+
11+
After Render does its magic, you will see your server listed in the <kbd>Services</kbd> section of the Dashboard. In there, you can see your server URL, at which you can access it.
12+
13+
![image showing where the URL can be found](https://user-images.githubusercontent.com/29888641/133103443-c20a6eab-7d35-46d2-80b0-107dd9237870.png)
14+
15+
## Creating the server manually
16+
17+
- [Connect your GitHub account to your Render account](https://render.com/docs/github).
18+
- Clone this repo.
19+
- Create a new web service using this repo and the following parameters:
20+
- Environment: Docker
21+
- Advanced > Add Environment Variable
22+
- key: SERVER_VERSION
23+
- value: v1.60.0
24+
- Advanced > Add Disk
25+
- Name: data
26+
- Mount Path: /home/workspace
27+
- Watch your OpenVSCode Server deploy, and then log in at the public URL listed below your web service name.
28+
29+
For a list of available `SERVER_VERSION` values, please refer to the [Releases](https://github.com/gitpod-io/openvscode-server/releases) page.

0 commit comments

Comments
 (0)