-
Notifications
You must be signed in to change notification settings - Fork 14
/
install-ubuntu.sh
59 lines (47 loc) · 1.77 KB
/
install-ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Install the raw deps
sudo apt update
sudo apt install -y fish
sudo apt install -y apt-utils
# Install docker
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo chmod 666 /var/run/docker.sock
# SSH Keys
ssh-keygen -t ed25519 -C "[email protected]"
ssh-add -K ~/.ssh/id_ed25519
# Copy into deploy keys on github
cat ~/.ssh/id_ed25519.pub
# Clone the repo
mkdir Code
cd Code/
git clone [email protected]:Oxen-AI/Oxen.git
cd Oxen/
# Build docker
docker build -t oxen/server:0.1.0 .
# Run in docker
docker run -d -v /var/oxen/data:/var/oxen/data -p 3000:3001 --name oxen oxen/server:0.1.0
# Or docker compose
docker compose up -d reverse-proxy
docker compose up -d --scale oxen=4 --no-recreate
# Build actual binary
sudo apt install -y libclang-dev
sudo apt install -y build-essential
sudo apt install -y libssl-dev
sudo apt install -y pkg-config
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install cargo-build-deps
# Build the server
cargo build --release
ln -s /path/to/release/build/oxen /usr/local/bin/oxen
# Run the server with a user
mkdir -p /home/ubuntu/Data/sync/
sudo env SYNC_DIR=/home/ubuntu/Data/sync/ ./target/release/oxen-server add-user --email [email protected] --name Ox --output user_config.toml
sudo env SYNC_DIR=/home/ubuntu/Data/sync/ ./target/release/oxen-server start -p 80