Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 9ff93c5

Browse files
hiento09sangjanai
andauthored
feat: install script for linux (#1677)
* feat: install script for linux * feat: linux bash install script support both .deb and binary * docs: update installation instruction for linux * fix: update updater to support install by bash script * chore: hardcode url for stable and beta * fix: update download url * chore: add warning for cortex update linux docs --------- Co-authored-by: Hien To <tominhhien97@gmail.com> Co-authored-by: vansangpfiev <sang@jan.ai>
1 parent 53cfc42 commit 9ff93c5

File tree

6 files changed

+181
-158
lines changed

6 files changed

+181
-158
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ Cortex also has a [Network Installer](#network-installer) which downloads the ne
5656

5757
<h4>
5858
<img src='https://github.com/janhq/docs/blob/main/static/img/linux.png' style="height:15px; width: 15px" />
59-
Linux:
60-
<a href='https://app.cortexcpp.com/download/latest/linux-amd64-local'><b>cortex.deb</b></a> (Coming soon: Linux installation script)
59+
Linux debian based distros:
60+
<a href='https://app.cortexcpp.com/download/latest/linux-amd64-local'><b>cortex-linux-local-installer.deb</b></a>
6161
</h4>
6262

6363
- For Linux: Download the installer and run the following command in terminal:
6464

6565
```bash
66-
sudo apt install ./cortex-local-installer.deb
66+
# Linux debian based distros
67+
curl -s https://raw.githubusercontent.com/janhq/cortex/main/engine/templates/linux/install.sh | sudo bash -s -- --deb_local
68+
69+
# Other Linux distros
70+
curl -s https://raw.githubusercontent.com/janhq/cortex/main/engine/templates/linux/install.sh | sudo bash -s
6771
```
6872

6973
- The binary will be installed in the `/usr/bin/` directory.
@@ -149,6 +153,28 @@ Select a model (1-9):
149153
```
150154

151155
## Advanced Installation
156+
157+
### Network Installer (Stable)
158+
159+
Cortex.cpp is available with a Network Installer, which is a smaller installer but requires internet connection during installation to download the necessary dependencies.
160+
161+
<h4>
162+
<img src='https://github.com/janhq/docs/blob/main/static/img/windows.png' style="height:14px; width: 14px" />
163+
Windows:
164+
<a href='https://app.cortexcpp.com/download/latest/windows-amd64-local'><b>cortex-windows-network-installer.exe</b></a>
165+
</h4>
166+
167+
<h4>
168+
<img src='https://github.com/janhq/docs/blob/main/static/img/mac.png' style="height:15px; width: 15px" />
169+
MacOS (Universal):
170+
<a href='https://app.cortexcpp.com/download/latest/mac-universal-network'><b>cortex-mac-network-installer.pkg</b></a>
171+
</h4>
172+
173+
<h4>
174+
<img src='https://github.com/janhq/docs/blob/main/static/img/linux.png' style="height:14px; width: 15px" />
175+
Linux debian based distros:
176+
<a href='https://app.cortexcpp.com/download/latest/linux-amd64-network'><b>cortex-linux-network-installer.deb</b></a>
177+
</h4>
152178

153179
### Beta & Nightly Versions (Local Installer)
154180

@@ -163,7 +189,7 @@ Cortex releases Beta and Nightly versions for advanced users to try new features
163189
<td style="text-align:center"><b>Version</b></td>
164190
<td style="text-align:center"><b>Windows</b></td>
165191
<td style="text-align:center"><b>MacOS</b></td>
166-
<td style="text-align:center"><b>Linux</b></td>
192+
<td style="text-align:center"><b>Linux debian based distros</b></td>
167193
</tr>
168194
<tr style="text-align:center">
169195
<td style="text-align:center"><b>Beta (Preview)</b></td>
@@ -218,7 +244,7 @@ Cortex.cpp is available with a Network Installer, which is a smaller installer b
218244
<td style="text-align:center"><b>Version Type</b></td>
219245
<td style="text-align:center"><b>Windows</b></td>
220246
<td style="text-align:center"><b>MacOS</b></td>
221-
<td style="text-align:center"><b>Linux</b></td>
247+
<td style="text-align:center"><b>Linux debian based distros</b></td>
222248
</tr>
223249
<tr style="text-align:center">
224250
<td style="text-align:center"><b>Stable (Recommended)</b></td>

docs/docs/installation/linux.mdx

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,35 @@ This instruction is for stable releases. For beta and nightly releases, please r
2020

2121
### Prerequisites
2222
- OpenMPI
23+
- curl
24+
- jq
25+
- tar
2326

2427
### Install Cortex.cpp
2528

26-
1. Download the Linux installer:
27-
- From release: https://github.com/janhq/cortex.cpp/releases
28-
- From quick download links:
29-
- Local installer `.deb`:
30-
- Stable: https://app.cortexcpp.com/download/latest/linux-amd64-local
31-
- Beta: https://app.cortexcpp.com/download/beta/linux-amd64-local
32-
- Nightly: https://app.cortexcpp.com/download/nightly/linux-amd64-local
33-
- Network installer `.deb`:
34-
- Stable: https://app.cortexcpp.com/download/latest/linux-amd64-network
35-
- Beta: https://app.cortexcpp.com/download/beta/linux-amd64-network
36-
- Nightly: https://app.cortexcpp.com/download/nightly/linux-amd64-network
37-
- Binary:
38-
- Stable: https://app.cortexcpp.com/download/latest/linux-amd64-binary
39-
- Beta: https://app.cortexcpp.com/download/beta/linux-amd64-binary
40-
- Nightly: https://app.cortexcpp.com/download/nightly/linux-amd64-binary
41-
42-
2. Install Cortex.cpp using the following command:
43-
```bash
44-
# Installer
45-
sudo apt install ./cortex-<version>-linux-amd64-network-installer.deb
29+
1. Install cortex with one command
4630

31+
- Linux debian base distros
32+
```bash
33+
# Network installer
34+
curl -s https://raw.githubusercontent.com/janhq/cortex/main/engine/templates/linux/install.sh | sudo bash -s
4735

48-
# Binary
49-
tar -xvf cortex-<version>-linux-amd64.tar.gz
50-
cd cortex
51-
sudo mv cortex /usr/bin/cortex
52-
sudo chmod +x /usr/bin/Cortexs
53-
sudo mv cortex-server /usr/bin/cortex-server
36+
# Local installer
37+
curl -s https://raw.githubusercontent.com/janhq/cortex/main/engine/templates/linux/install.sh | sudo bash -s -- --deb_local
38+
```
5439

55-
## For binary, you need to install engine manually after extracting the binary
56-
cortex engines install llama-cpp
57-
```
40+
- Other linux distros
41+
```bash
42+
curl -s https://raw.githubusercontent.com/janhq/cortex/main/engine/templates/linux/install.sh | sudo bash -s
43+
```
44+
45+
- Parameters
46+
- `--channel <channel_name>` cortex channel will be installed `stable`, `beta` or `nightly`. Default vaule is `stable`
47+
- `--version <version>` version cortex want to install Ex `--version 1.0.2`. Default the script will get latest version of corresponding channel
48+
- `--is_update` the current command run is for update
49+
- `--deb_local` Using local installer for linux debian base distros
5850

59-
3. Ensure that Cortex.cpp is sucessfulyy installed:
51+
2. Ensure that Cortex.cpp is sucessfulyy installed:
6052
```bash
6153
# Stable
6254
cortex -v
@@ -79,7 +71,7 @@ By default, Cortex.cpp is installed in the following directory:
7971
## Uninstall Cortex.cpp
8072
```bash
8173
# Stable version
82-
sudo apt remove cortexcpp
74+
sudo /usr/bin/cortex-uninstall.sh
8375
```
8476

8577
## Build from Source
@@ -115,9 +107,10 @@ sudo apt remove cortexcpp
115107
```
116108

117109
## Update cortex to latest version
118-
:::info
119-
The script requires sudo permission. Supported for debians based systems only (Ubuntu, Debian, etc).
110+
:::warning
111+
🚧 The script requires sudo permissions and works only if the user follows the installation instructions above or if the cortex binary file and the cortex-server binary file are installed in /usr/bin for all Linux distributions. If your binary files are located in a different folder, please manually update the binary files.
120112
:::
113+
121114
```bash
122115
sudo cortex update
123116
```

0 commit comments

Comments
 (0)