Skip to content

Commit a40dabb

Browse files
committed
Add install script to docs
1 parent e0172d0 commit a40dabb

File tree

4 files changed

+68
-65
lines changed

4 files changed

+68
-65
lines changed

README.md

+6-56
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,21 @@ For a full setup and walkthrough, please see [./doc/guide.md](./doc/guide.md).
1717

1818
## Install
1919

20-
You can easily and securely install code-server with our install script on any Linux or macOS machine.
20+
We have a script to install code-server on Linux or macOS preferring to use the system package manager.
21+
22+
First run to print out the install process:
2123

2224
```bash
23-
# First run to print out the install process.
2425
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
25-
# Now it will actually install.
26-
curl -fsSL https://code-server.dev/install.sh | sh
27-
```
28-
29-
```
30-
$ curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run --help
31-
32-
$0 [--dry-run] [--version X.X.X] [--static <install-prefix>=~/.local]
33-
34-
Installs latest code-server on any macOS or Linux system preferring to use the OS package manager.
35-
36-
curl -fsSL https://code-server.dev/install.sh | sh -s --
37-
38-
- For Debian, Ubuntu, Raspbian it will install the latest deb package.
39-
- For Fedora, CentOS, RHEL, openSUSE it will install the latest rpm package.
40-
- For Arch Linux it will install the AUR package.
41-
- For any unrecognized Linux operating system it will install the latest static release into ~/.local
42-
- Add ~/.local/bin to your \$PATH to run code-server.
43-
44-
- For macOS it will install the Homebrew package.
45-
- If Homebrew is not installed it will install the latest static release into ~/.local
46-
- Add ~/.local/bin to your \$PATH to run code-server.
47-
48-
- If ran on an architecture with no binary releases or glibc < v2.17, it will install the
49-
npm package with yarn or npm.
50-
- We only have binary releases for amd64 and arm64 presently.
51-
52-
--dry-run Enables a dry run where where the steps that would have taken place
53-
are printed but do not actually execute.
54-
55-
--version Pass to install a specific version instead of the latest release.
56-
57-
--static Forces the installation of a static release into ~/.local
58-
59-
This flag takes an optional argument for the installation prefix which defaults to "~/.local".
60-
code-server will be unarchived into ~/.local/lib/code-server.X.X.X and the binary will be symlinked
61-
into "~/.local/bin/code-server". You will need to add ~/.local/bin to your \$PATH to use it without
62-
the full path.
63-
64-
To install system wide set the prefix to /usr/local.
6526
```
6627

67-
If you still don't trust our install script, even with the above explaination and the dry run, we have
68-
docs in [./doc/install.md](./doc/install.md) that explain how to install `code-server` on a variety of
69-
platforms. The script runs the exact same commands.
70-
71-
### Docker
28+
Now to actually install:
7229

7330
```bash
74-
# This will start a code-server container and expose it at http://127.0.0.1:8080.
75-
# It will also mount your current directory into the container as `/home/coder/project`
76-
# and forward your UID/GID so that all file system operations occur as your user outside
77-
# the container.
78-
docker run -it -p 127.0.0.1:8080:8080 \
79-
-v "$PWD:/home/coder/project" \
80-
-u "$(id -u):$(id -g)" \
81-
codercom/code-server:latest
31+
curl -fsSL https://code-server.dev/install.sh | sh
8232
```
8333

84-
You should also check out
34+
Docs on the install script, manual installation and docker instructions are at [./doc/install.md](./doc/install.md).
8535

8636
## FAQ
8737

doc/guide.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,23 @@ to avoid the slow dashboard.
7777

7878
## 2. Install code-server
7979

80-
SSH into your instance and run the appropriate commands documented in [README.md](../README.md).
80+
We have a script to install code-server on Linux or macOS preferring to use the system package manager.
8181

82-
Assuming Debian:
82+
First run to print out the install process:
8383

8484
```bash
85-
curl -fOL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server_3.3.1_amd64.deb
86-
sudo dpkg -i code-server_3.3.1_amd64.deb
87-
systemctl --user enable --now code-server
88-
# Now code-server is running at http://127.0.0.1:8080
89-
# Your password is in ~/.config/code-server/config.yaml
85+
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
9086
```
9187

88+
Now to actually install:
89+
90+
```bash
91+
curl -fsSL https://code-server.dev/install.sh | sh
92+
```
93+
94+
Docs on the install script, manual installation and docker instructions are at [./doc/install.md](./doc/install.md).
95+
96+
9297
## 3. Expose code-server
9398

9499
**Never**, **ever** expose `code-server` directly to the internet without some form of authentication

doc/install.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,43 @@ print out the commands it will run to install `code-server` but
2323
not run anything. That way you can verify the script is functioning
2424
as intended before installing.
2525

26+
## install.sh
27+
28+
We have a script to install code-server on Linux or macOS preferring to use the system package manager.
29+
30+
First run to print out the install process:
31+
32+
```bash
33+
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
34+
```
35+
36+
Now to actually install:
37+
38+
```bash
39+
curl -fsSL https://code-server.dev/install.sh | sh
40+
```
41+
42+
- For Debian, Ubuntu, Raspbian it will install the latest deb package.
43+
- For Fedora, CentOS, RHEL, openSUSE it will install the latest rpm package.
44+
- For Arch Linux it will install the AUR package.
45+
- For any unrecognized Linux operating system it will install the latest static release into ~/.local
46+
- Add ~/.local/bin to your $PATH to run code-server.
47+
48+
- For macOS it will install the Homebrew package.
49+
- If Homebrew is not installed it will install the latest static release into ~/.local
50+
- Add ~/.local/bin to your $PATH to run code-server.
51+
52+
- If ran on an architecture with no binary releases, it will install the npm package with yarn or npm.
53+
- We only have binary releases for amd64 and arm64 presently.
54+
55+
Pass `--static` to install a static release into `~/.local`.
56+
Pass `--static=/usr/local` to install a static release system wide.
57+
Pass `--version=X.X.X` to install version `X.X.X` instead of latest.
58+
59+
If you still don't trust our install script, even with the above explaination and the dry run,
60+
continue for docs on manual installation. The script runs the exact same commands depicted
61+
in the rest of this document.
62+
2663
## Debian, Ubuntu
2764

2865
```bash
@@ -113,4 +150,15 @@ code-server
113150

114151
## Docker
115152

116-
Documented in [README.md](../README.md#docker).
153+
```bash
154+
# This will start a code-server container and expose it at http://127.0.0.1:8080.
155+
# It will also mount your current directory into the container as `/home/coder/project`
156+
# and forward your UID/GID so that all file system operations occur as your user outside
157+
# the container.
158+
docker run -it -p 127.0.0.1:8080:8080 \
159+
-v "$PWD:/home/coder/project" \
160+
-u "$(id -u):$(id -g)" \
161+
codercom/code-server:latest
162+
```
163+
164+
You should also check out

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ EOF
1616
)"$"\n"
1717
fi
1818
cat << EOF
19-
Installs latest code-server on Linux or macOS preferring to use the system package manager.
19+
Installs the latest code-server on Linux or macOS preferring to use the system package manager.
2020
2121
Lives at https://code-server.dev/install.sh
2222

0 commit comments

Comments
 (0)