1515
1616<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1717
18- This guide demonstrates how to setup and use code-server.
19- To reiterate, code-server lets you run VS Code on a remote server and then access it via a browser.
18+ This guide demonstrates how to setup and use ` code-server ` .
19+ To reiterate, ` code-server ` lets you run VS Code on a remote server and then access it via a browser.
2020
2121Further docs are at:
2222
23- - [ README.md] ( ../README.md ) for a general overview
24- - [ FAQ.md] ( ./FAQ.md ) for common questions.
25- - [ CONTRIBUTING.md] ( ../doc/CONTRIBUTING.md ) for development docs
23+ - [ README] ( ../README.md ) for a general overview
24+ - [ INSTALL] ( ../doc/install.md ) for installation
25+ - [ FAQ] ( ./FAQ.md ) for common questions.
26+ - [ CONTRIBUTING] ( ../doc/CONTRIBUTING.md ) for development docs
2627
27- We'll walk you through acquiring a remote machine to run code-server on
28+ We'll walk you through acquiring a remote machine to run ` code-server ` on
2829and then exposing ` code-server ` so you can securely access it.
2930
3031## 1. Acquire a remote machine
3132
32- First, you need a machine to run code-server on. You can use a physical
33+ First, you need a machine to run ` code-server ` on. You can use a physical
3334machine you have lying around or use a VM on GCP/AWS.
3435
3536### Requirements
@@ -64,7 +65,6 @@ Once you've signed up and created a GCP project, create a new Compute Engine VM
6465 - Click ` Change ` under ` Boot Disk ` and change the type to ` SSD Persistent Disk ` and the size
6566 to ` 32 ` .
6667 - You can always grow your disk later.
67- - The default OS of Debian 10 is fine.
68688 . Navigate to ` Networking -> Network interfaces ` and edit the existing interface
6969 to use a static external IP.
7070 - Click done to save network interface changes.
@@ -78,7 +78,7 @@ to avoid the slow dashboard.
7878
7979## 2. Install code-server
8080
81- [ We have a script] ( ./install.sh ) to install code-server for Linux and macOS.
81+ We have a [ script] ( ./install.sh ) to install ` code-server ` for Linux and macOS.
8282
8383It tries to use the system package manager if possible.
8484
@@ -94,7 +94,7 @@ Now to actually install:
9494curl -fsSL https://code-server.dev/install.sh | sh
9595```
9696
97- The install script will print out how to run and start using code-server.
97+ The install script will print out how to run and start using ` code-server ` .
9898
9999Docs on the install script, manual installation and docker image are at [ ./doc/install.md] ( ./doc/install.md ) .
100100
@@ -103,45 +103,44 @@ Docs on the install script, manual installation and docker image are at [./doc/i
103103** Never** , ** ever** expose ` code-server ` directly to the internet without some form of authentication
104104and encryption as someone can completely takeover your machine with the terminal.
105105
106- By default, code-server will enable password authentication which will
107- require you to copy the password from the code-server config file to login. Since it
108- cannot use TLS by default, it will listen on ` localhost ` to avoid exposing itself
109- to the world. This is fine for testing but will not work if you want to access ` code-server `
106+ By default, ` code-server ` will enable password authentication which will require you to copy the
107+ password from the` code-server ` config file to login. It will listen on` localhost ` to avoid exposing
108+ itself to the world. This is fine for testing but will not work if you want to access ` code-server `
110109from a different machine.
111110
112- There are several approaches to securely operating and exposing code-server.
111+ There are several approaches to securely operating and exposing ` code-server ` .
113112
114- ** tip** : You can list the full set of code-server options with ` code-server --help `
113+ ** tip** : You can list the full set of ` code-server ` options with ` code-server --help `
115114
116115### SSH forwarding
117116
118117We highly recommend this approach for not requiring any additional setup, you just need an
119118SSH server on your remote machine. The downside is you won't be able to access ` code-server `
120- without an SSH client like an iPad. If that's important to you, skip to [ Let's Encrypt] ( #lets-encrypt ) .
119+ on any machine without an SSH client like on iPad. If that's important to you, skip to [ Let's Encrypt] ( #lets-encrypt ) .
121120
122- Recommended reading: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding .
123-
124- First, ssh into your instance and edit your code-server config file to disable password authentication.
121+ First, ssh into your instance and edit your ` code-server ` config file to disable password authentication.
125122
126123``` bash
127124# Replaces "auth: password" with "auth: none" in the code-server config.
128125sed -i.bak ' s/auth: password/auth: none/' ~ /.config/code-server/config.yaml
129126```
130127
131- Restart code-server with (assuming you followed the guide):
128+ Restart ` code-server ` with (assuming you followed the guide):
132129
133130``` bash
134131systemctl --user restart code-server
135132```
136133
137134Now forward local port 8080 to ` 127.0.0.1:8080 ` on the remote instance.
138135
136+ Recommended reading: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding .
137+
139138``` bash
140139# -N disables executing a remote shell
141140ssh -N -L 8080:127.0.0.1:8080 < instance-ip>
142141```
143142
144- Now if you access http://127.0.0.1:8080 locally, you should see code-server!
143+ Now if you access http://127.0.0.1:8080 locally, you should see ` code-server ` !
145144
146145If you want to make the SSH port forwarding persistent we recommend using
147146[ mutagen] ( https://mutagen.io/documentation/introduction/installation ) .
@@ -168,8 +167,8 @@ and sign commits without copying your keys.
168167
169168### Let's Encrypt
170169
171- [ Let's Encrypt] ( https://letsencrypt.org ) is a great option if you want to access code-server on an iPad
172- or do not want to use SSH forwarding. This does require that the remote machine is exposed to the internet.
170+ [ Let's Encrypt] ( https://letsencrypt.org ) is a great option if you want to access ` code-server ` on an iPad
171+ or do not want to use SSH forwarding. This does require that the remote machine be exposed to the internet.
173172
174173Assuming you have been following the guide, edit your instance and checkmark the allow HTTP/HTTPS traffic options.
175174
@@ -198,9 +197,9 @@ reverse_proxy 127.0.0.1:8080
198197sudo systemctl reload caddy
199198```
200199
201- Visit ` https://<your-domain-name> ` to access code-server. Congratulations!
200+ Visit ` https://<your-domain-name> ` to access ` code-server ` . Congratulations!
202201
203- In a future release we plan to integrate Let's Encrypt directly with code-server to avoid
202+ In a future release we plan to integrate Let's Encrypt directly with ` code-server ` to avoid
204203the dependency on caddy.
205204
206205### Self Signed Certificate
@@ -210,13 +209,12 @@ have to use [Let's Encrypt](#lets-encrypt) instead. See the [FAQ](https://github
210209
211210Recommended reading: https://security.stackexchange.com/a/8112 .
212211
213- We recommend this as a last resort as self signed certificates do not work with iPads and can
214- cause other bizarre issues. Not to mention all the warnings when you access code-server.
212+ We recommend this as a last resort because self signed certificates do not work with iPads and can
213+ cause other bizarre issues. Not to mention all the warnings when you access ` code-server ` .
215214Only use this if:
216215
217- 1 . You do not want to buy a domain.
218- 2 . You cannot expose the remote machine to the internet.
219- 3 . You do not want to use SSH forwarding.
216+ 1 . You do not want to buy a domain or you cannot expose the remote machine to the internet.
217+ 2 . You do not want to use SSH forwarding.
220218
221219ssh into your instance and edit your code-server config file to use a randomly generated self signed certificate:
222220
@@ -229,32 +227,32 @@ sed -i.bak 's/bind-addr: 127.0.0.1:8080/bind-addr: 0.0.0.0:443/' ~/.config/code-
229227sudo setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node
230228```
231229
232- Assuming you have been following the guide, restart code-server with:
230+ Assuming you have been following the guide, restart ` code-server ` with:
233231
234232``` bash
235233systemctl --user restart code-server
236234```
237235
238236Edit your instance and checkmark the allow HTTPS traffic option.
239237
240- Visit ` https://<your-instance-ip> ` to access code-server.
238+ Visit ` https://<your-instance-ip> ` to access ` code-server ` .
241239You'll get a warning when accessing but if you click through you should be good.
242240
243241To avoid the warnings, you can use [ mkcert] ( https://mkcert.dev ) to create a self signed certificate
244- trusted by your OS and then pass it into code-server via the ` cert ` and ` cert-key ` config
242+ trusted by your OS and then pass it into ` code-server ` via the ` cert ` and ` cert-key ` config
245243fields.
246244
247245### Change the password?
248246
249- Edit the ` password ` field in the code-server config file at ` ~/.config/code-server/config.yaml `
250- and then restart code-server with:
247+ Edit the ` password ` field in the ` code-server ` config file at ` ~/.config/code-server/config.yaml `
248+ and then restart ` code-server ` with:
251249
252250``` bash
253251systemctl --user restart code-server
254252```
255253
256254### How do I securely access development web services?
257255
258- If you're working on a web service and want to access it locally, code-server can proxy it for you.
256+ If you're working on a web service and want to access it locally, ` code-server ` can proxy it for you.
259257
260- See [ FAQ.md ] ( https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-securely-access-web-services ) .
258+ See the [ FAQ] ( https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-securely-access-web-services ) .
0 commit comments