Skip to content

Commit 92af87a

Browse files
committed
Add install.sh into README.md
1 parent e905a72 commit 92af87a

File tree

3 files changed

+113
-76
lines changed

3 files changed

+113
-76
lines changed

README.md

+17-75
Original file line numberDiff line numberDiff line change
@@ -15,66 +15,30 @@ Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and a
1515

1616
For a full setup and walkthrough, please see [./doc/guide.md](./doc/guide.md).
1717

18-
### Debian, Ubuntu
18+
## Install
1919

20-
```bash
21-
curl -fOL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server_3.3.1_amd64.deb
22-
sudo dpkg -i code-server_3.3.1_amd64.deb
23-
systemctl --user enable --now code-server
24-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
25-
```
26-
27-
### Fedora, CentOS, Red Hat, SUSE
28-
29-
```bash
30-
curl -fOL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server-3.3.1-amd64.rpm
31-
sudo rpm -i code-server-3.3.1-amd64.rpm
32-
systemctl --user enable --now code-server
33-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
34-
```
35-
36-
### Arch Linux
20+
You can easily and securely install code-server with our install script.
3721

3822
```bash
39-
# Installs code-server from the AUR using yay.
40-
yay -S code-server
41-
systemctl --user enable --now code-server
42-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
23+
# First run to print out the install process.
24+
curl -sSL https://get.docker.com/ | sh -s -- --dry-run
25+
# Now it will actually install.
26+
curl -sSL https://get.docker.com/ | sh -s --
4327
```
4428

45-
```bash
46-
# Installs code-server from the AUR with plain makepkg.
47-
git clone https://aur.archlinux.org/code-server.git
48-
cd code-server
49-
makepkg -si
50-
systemctl --user enable --now code-server
51-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
52-
```
53-
54-
### yarn, npm
55-
56-
We recommend installing with `yarn` or `npm` if we don't have a precompiled release for your machine's
57-
platform or architecture or your glibc < v2.19.
58-
59-
**note:** Installing via `yarn` or `npm` builds native modules on install and so requires C dependencies.
60-
See [./doc/npm.md](./doc/npm.md) for installing these dependencies.
61-
62-
You will need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
29+
- For Debian, Ubuntu, Raspbian it will install the latest deb package.
30+
- For Fedora, CentOS, RHEL, openSUSE it will install the latest rpm package.
31+
- For Arch Linux it will install the AUR package.
32+
- For any unrecognized Linux operating system it will install the latest static release into `/usr/local/lib/code-server-X.X.X`.
33+
- For macOS it will install the Homebrew package.
34+
- If Homebrew is not installed it will install the latest static release into `/usr/local/lib/code-server-X.X.X`.
6335

64-
```bash
65-
yarn global add code-server
66-
# Or: npm install -g code-server
67-
code-server
68-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
69-
```
36+
If ran on an architecture with no binary releases, it will install the npm package with `yarn` or `npm`.
37+
We only have binary releases for `amd64` and `arm64` presently.
7038

71-
### macOS
72-
73-
```bash
74-
brew install code-server
75-
brew services start code-server
76-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
77-
```
39+
If you still don't trust our install script, even with the above explaination and the dry run, we have
40+
docs in [./doc/install.md](./doc/install.md) that explain how to install `code-server` each of the above
41+
operating systems. The script runs the exact same commands.
7842

7943
### Docker
8044

@@ -89,28 +53,6 @@ docker run -it -p 127.0.0.1:8080:8080 \
8953
codercom/code-server:latest
9054
```
9155

92-
### Static Releases
93-
94-
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
95-
They bundle the node binary and node_modules.
96-
97-
1. Download the latest release archive for your system from [github](https://github.com/cdr/code-server/releases).
98-
2. Unpack the release.
99-
3. You can run code-server by executing `./bin/code-server`.
100-
101-
Add the code-server `bin` directory to your `$PATH` to easily execute `code-server` without the full path every time.
102-
103-
Here is an example script for installing and using a static `code-server` release on Linux:
104-
105-
```bash
106-
curl -fL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server-3.3.1-linux-amd64.tar.gz \
107-
| sudo tar -C /usr/local/lib -xz
108-
sudo mv /usr/local/lib/code-server-3.3.1-linux-amd64 /usr/local/lib/code-server-3.3.1
109-
PATH="/usr/local/lib/code-server-3.3.1/bin:$PATH"
110-
code-server
111-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
112-
```
113-
11456
## FAQ
11557

11658
See [./doc/FAQ.md](./doc/FAQ.md).

doc/install.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Install
2+
3+
This document demonstrates how to install `code-server` on
4+
various distros and operating systems.
5+
6+
The steps in this document are exactly what the install script does.
7+
8+
We recommend using the install script if possible. You can run
9+
the install script with the `--dry-run` flag for a dry run which will
10+
print out the commands it will run to install `code-server` but
11+
not run anything. That way you can verify the script is functioning
12+
as intended before installing.
13+
14+
## Debian, Ubuntu
15+
16+
```bash
17+
curl -fOL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server_3.3.1_amd64.deb
18+
sudo dpkg -i code-server_3.3.1_amd64.deb
19+
systemctl --user enable --now code-server
20+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
21+
```
22+
23+
## Fedora, CentOS, Red Hat, SUSE
24+
25+
```bash
26+
curl -fOL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server-3.3.1-amd64.rpm
27+
sudo rpm -i code-server-3.3.1-amd64.rpm
28+
systemctl --user enable --now code-server
29+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
30+
```
31+
32+
## Arch Linux
33+
34+
```bash
35+
# Installs code-server from the AUR using yay.
36+
yay -S code-server
37+
systemctl --user enable --now code-server
38+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
39+
```
40+
41+
```bash
42+
# Installs code-server from the AUR with plain makepkg.
43+
git clone https://aur.archlinux.org/code-server.git
44+
cd code-server
45+
makepkg -si
46+
systemctl --user enable --now code-server
47+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
48+
```
49+
50+
## yarn, npm
51+
52+
We recommend installing with `yarn` or `npm` if we don't have a precompiled release for your machine's
53+
platform or architecture or your glibc < v2.19.
54+
55+
**note:** Installing via `yarn` or `npm` builds native modules on install and so requires C dependencies.
56+
See [./doc/npm.md](./doc/npm.md) for installing these dependencies.
57+
58+
You will need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
59+
60+
```bash
61+
yarn global add code-server
62+
# Or: npm install -g code-server
63+
code-server
64+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
65+
```
66+
67+
## macOS
68+
69+
```bash
70+
brew install code-server
71+
brew services start code-server
72+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
73+
```
74+
75+
## Static Releases
76+
77+
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
78+
They bundle the node binary and node_modules.
79+
80+
1. Download the latest release archive for your system from [github](https://github.com/cdr/code-server/releases).
81+
2. Unpack the release.
82+
3. You can run code-server by executing `./bin/code-server`.
83+
84+
Add the code-server `bin` directory to your `$PATH` to easily execute `code-server` without the full path every time.
85+
86+
Here is an example script for installing and using a static `code-server` release on Linux:
87+
88+
```bash
89+
curl -fL https://github.com/cdr/code-server/releases/download/v3.3.1/code-server-3.3.1-linux-amd64.tar.gz \
90+
| sudo tar -C /usr/local/lib -xz
91+
sudo mv /usr/local/lib/code-server-3.3.1-linux-amd64 /usr/local/lib/code-server-3.3.1
92+
PATH="/usr/local/lib/code-server-3.3.1/bin:$PATH"
93+
code-server
94+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
95+
```

doc/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sudo apt-get install -y \
1616
libsecret-1-dev
1717
```
1818

19-
## Fedora, CentOS, Red Hat
19+
## Fedora, CentOS, RHEL
2020

2121
```bash
2222
sudo yum groupinstall -y 'Development Tools'

0 commit comments

Comments
 (0)