INSTALL_HETZNER.md 1.42 KB
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
1
# Instructions to install libre.sh
Pierre Ozoux's avatar
Pierre Ozoux committed
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

## Recommendation
- ssd on /dev/sda
- hdd on /dev/sdb
- hdd on /dev/sdc
- API key on Namecheap (if you want to automatically buy domain name)

# Installation

First, you need a server.
We recommend [Hetzner](https://serverboerse.de/index.php?country=EN) as they are the cheapest options around.
You can filter servers with ssd.

These instructions can also work on any VM/VPS/Hardware.

## Install the system

```
IP=

ssh -o "StrictHostKeyChecking no" root@$IP

hostname=
ssh_public_key=""

fdisk -l #find your ssd

# Setup raid
cat > /etc/mdadm.conf << EOF
MAILADDR dev@null.org
EOF
mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdb /dev/sdc
mkfs.ext4 /dev/md0

cat > cloud-config.tmp << EOF
#cloud-config

hostname: "$hostname"
ssh_authorized_keys:
  - $ssh_public_key
EOF

OliCat's avatar
OliCat committed
44
apt-get install gawk
Pierre Ozoux's avatar
Pierre Ozoux committed
45 46 47 48 49 50 51 52
wget https://raw.github.com/coreos/init/master/bin/coreos-install
bash coreos-install -d /dev/sda -c cloud-config.tmp

reboot
```

```
ssh core@$IP
OliCat's avatar
OliCat committed
53

OliCat's avatar
OliCat committed
54
#configure mdmonitor.
OliCat's avatar
OliCat committed
55

Pierre Ozoux's avatar
Pierre Ozoux committed
56 57
sudo su -

OliCat's avatar
OliCat committed
58 59 60 61 62 63 64 65
mdadm --examine --scan > /etc/mdadm.conf
vim /etc/mdadm.conf
#ADD your mail
MAILADDR xxx@xxx.org

# Start service
systemctl start  mdmonitor.service

JꙨdцӍoηҬ's avatar
typo  
JꙨdцӍoηҬ committed
66
cat > /etc/systemd/system/data.mount << EOF
Pierre Ozoux's avatar
Pierre Ozoux committed
67 68 69 70
[Mount]
What=/dev/md0
Where=/data
Type=ext4
Pierre Ozoux's avatar
Pierre Ozoux committed
71 72
EOF

Pierre Ozoux's avatar
Pierre Ozoux committed
73
wget https://raw.githubusercontent.com/indiehosters/libre.sh/master/user_data -O /var/lib/coreos-install/user_data
Pierre Ozoux's avatar
Pierre Ozoux committed
74

Pierre Ozoux's avatar
Pierre Ozoux committed
75
coreos-cloudinit /var/lib/coreos-install/user_data