Skip to content

Commit cbb8e6c

Browse files
authored
Merge pull request #3351 from replicatedhq/125602
Add new topic on setting up your environment for replicated
2 parents 664192c + fe9857c commit cbb8e6c

File tree

7 files changed

+376
-76
lines changed

7 files changed

+376
-76
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
:::note
2+
For Windows users, Replicated recommends using Windows Subsystem for Linux (WSL2) and installing the Replicated using the Linux installations above. See [Linux / Windows Subsystem for Linux (WSL2)](#linux-wsl2).
3+
:::
4+
5+
Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [(Optional) Set Environment Variables](#env-var) below.
6+
7+
To install and run the latest Replicated CLI in Docker environments:
8+
9+
1. Generate a service account or user API token in the vendor portal. To create new releases, the token must have `Read/Write` access. See [Generating API Tokens](/vendor/replicated-api-tokens).
10+
11+
1. Get the latest Replicated CLI installation files from the [replicatedhq/replicated repository](https://github.com/replicatedhq/replicated/releases) on GitHub.
12+
13+
Download and install the files. For simplicity, the usage in the next step is represented assuming that the CLI is downloaded and installed to the desktop.
14+
15+
1. Authorize the Replicated CLI:
16+
17+
- Through a Docker container:
18+
19+
```shell
20+
docker run \
21+
-e REPLICATED_API_TOKEN=$TOKEN \
22+
replicated/vendor-cli --help
23+
```
24+
Replace `TOKEN` with your API token.
25+
26+
- On Windows:
27+
28+
```dos
29+
docker.exe run \
30+
-e REPLICATED_API_TOKEN=%TOKEN% \
31+
replicated/vendor-cli --help
32+
```
33+
34+
Replace `TOKEN` with your API token.
35+
36+
For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Run the following command:
2+
3+
```shell
4+
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
5+
| grep "browser_download_url.*linux_amd64.tar.gz" \
6+
| cut -d : -f 2,3 \
7+
| tr -d \") -o replicated.tar.gz
8+
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
9+
mv replicated /usr/local/bin/replicated
10+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Run one of the following commands:
2+
3+
- With Brew:
4+
5+
```shell
6+
brew install replicatedhq/replicated/cli
7+
```
8+
9+
- Without Brew:
10+
11+
```shell
12+
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
13+
| grep "browser_download_url.*darwin_all.tar.gz" \
14+
| cut -d : -f 2,3 \
15+
| tr -d \") -o replicated.tar.gz
16+
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
17+
mv replicated /usr/local/bin/replicated
18+
```

docs/reference/replicated-cli-installing.mdx

Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import Verify from "../partials/replicated-cli/_verify-install.mdx"
2+
import InstallMac from "../partials/replicated-cli/_install-mac.mdx"
3+
import InstallLinux from "../partials/replicated-cli/_install-linux.mdx"
4+
import InstallDocker from "../partials/replicated-cli/_install-docker.mdx"
25
import Sudo from "../partials/replicated-cli/_sudo-install.mdx"
36
import Login from "../partials/replicated-cli/_login.mdx"
47
import Logout from "../partials/replicated-cli/_logout.mdx"
@@ -30,24 +33,7 @@ You can install and run the Replicated CLI in the following environments:
3033

3134
To install and run the latest Replicated CLI on MacOS:
3235

33-
1. Run one of the following commands:
34-
35-
- With Brew:
36-
37-
```shell
38-
brew install replicatedhq/replicated/cli
39-
```
40-
41-
- Without Brew:
42-
43-
```shell
44-
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
45-
| grep "browser_download_url.*darwin_all.tar.gz" \
46-
| cut -d : -f 2,3 \
47-
| tr -d \") -o replicated.tar.gz
48-
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
49-
mv replicated /usr/local/bin/replicated
50-
```
36+
1. <InstallMac/>
5137

5238
<Sudo/>
5339

@@ -59,20 +45,13 @@ To install and run the latest Replicated CLI on MacOS:
5945

6046
1. <Logout/>
6147

62-
### Linux
48+
### Linux / Windows Subsystem for Linux (WSL) {#linux-wsl2}
6349

64-
To install and run the latest Replicated CLI on Linux:
50+
To install and run the latest Replicated CLI on Linux or Windows Subsystem for Linux (WSL):
6551

66-
1. Run the following command:
52+
1. For Windows users, first install Linux on Windows using WSL2. See [How to install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
6753

68-
```shell
69-
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
70-
| grep "browser_download_url.*linux_amd64.tar.gz" \
71-
| cut -d : -f 2,3 \
72-
| tr -d \") -o replicated.tar.gz
73-
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
74-
mv replicated /usr/local/bin/replicated
75-
```
54+
1. <InstallLinux/>
7655

7756
<Sudo/>
7857

@@ -86,38 +65,7 @@ To install and run the latest Replicated CLI on Linux:
8665

8766
### Docker / Windows
8867

89-
Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [(Optional) Set Environment Variables](#env-var) below.
90-
91-
To install and run the latest Replicated CLI in Docker environments:
92-
93-
1. Generate a service account or user API token in the vendor portal. To create new releases, the token must have `Read/Write` access. See [Generating API Tokens](/vendor/replicated-api-tokens).
94-
95-
1. Get the latest Replicated CLI installation files from the [replicatedhq/replicated repository](https://github.com/replicatedhq/replicated/releases) on GitHub.
96-
97-
Download and install the files. For simplicity, the usage in the next step is represented assuming that the CLI is downloaded and installed to the desktop.
98-
99-
1. Authorize the Replicated CLI:
100-
101-
- Through a Docker container:
102-
103-
```shell
104-
docker run \
105-
-e REPLICATED_API_TOKEN=$TOKEN \
106-
replicated/vendor-cli --help
107-
```
108-
Replace `TOKEN` with your API token.
109-
110-
- On Windows:
111-
112-
```dos
113-
docker.exe run \
114-
-e REPLICATED_API_TOKEN=%TOKEN% \
115-
replicated/vendor-cli --help
116-
```
117-
118-
Replace `TOKEN` with your API token.
119-
120-
For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation.
68+
<InstallDocker/>
12169

12270
## (Optional) Set Environment Variables {#env-var}
12371

0 commit comments

Comments
 (0)