Skip to content
Snippets Groups Projects
Commit 159b745c authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Simpler instructions for DO

parent 28715dad
No related branches found
No related tags found
No related merge requests found
# Instructions to install LibrePaaS # Instructions to install LibrePaaS
## Recommendation ## 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) - API key on Namecheap (if you want to automatically buy domain name)
# Installation ## Installation
First, you need a server. First, you need a server.
We recommend [Hetzner](https://serverboerse.de/index.php?country=EN) as they are the cheapest options around. You can take it from a cloud provider, like DigitalOcean or Scaleway and choose to spin up a VM with CoreOS already installed on it.
You can filter servers with ssd.
These instructions can also work on any VM/VPS/Hardware. You can also buy a baremetal at [Hetzner](https://serverboerse.de/index.php?country=EN) as they are the cheapest options around. Follow these [instructions](INSTALL_HETZNER.md) in this case.
## 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
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
sudo su -
# Add swap
fallocate -l 8192m /swap
chmod 600 /swap
mkswap /swap
cat > /var/lib/coreos-install/user_data << EOF
#cloud-config #cloud-config
hostname: $hostname hostname: $hostname
...@@ -102,31 +56,46 @@ coreos: ...@@ -102,31 +56,46 @@ coreos:
units: units:
- name: systemd-sysctl.service - name: systemd-sysctl.service
command: restart command: restart
- name: data.mount
command: start
content: |
[Mount]
What=/dev/md0
Where=/data
Type=ext4
- name: swap.service - name: swap.service
command: start command: start
content: | content: |
[Unit]
Description=Turn on swap
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=true
ExecStartPre=-/bin/bash -euxc ' \
fallocate -l 8192m /swap \
chmod 600 /swap \
mkswap /swap'
ExecStart=/sbin/swapon /swap ExecStart=/sbin/swapon /swap
EOF ExecStop=/sbin/swapoff /swap
[Install]
# Create Directory structure WantedBy=local.target
git clone https://github.com/indiehosters/LibrePaaS.git /indiehosters - name: install-compose.service
mkdir /{data,system} command: start
mkdir /data/trash content: |
[unit]
# Install unit-files and utils Description=Install Docker Compose
cp /indiehosters/unit-files/* /etc/systemd/system && systemctl daemon-reload [Service]
cp /indiehosters/utils/* /opt/bin/ Type=oneshot
RemainAfterExit=true
mkdir -p /opt/bin ExecStart=-/bin/bash -euxc ' \
DOCKER_COMPOSE_VERSION=1.6.0 mkdir -p /opt/bin \
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose \
chmod +x /opt/bin/docker-compose chmod +x /opt/bin/docker-compose'
- name: install-indiehosters.service
command: start
content: |
[unit]
Description=Install IndieHosters
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
git clone https://github.com/indiehosters/LibrePaaS.git /indiehosters \
mkdir /{data,system} \
mkdir /data/trash \
cp /indiehosters/unit-files/* /etc/systemd/system && systemctl daemon-reload \
cp /indiehosters/utils/* /opt/bin/'
```
# Instructions to install LibrePaaS
## 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
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
sudo su -
# Add swap
fallocate -l 8192m /swap
chmod 600 /swap
mkswap /swap
cat > /var/lib/coreos-install/user_data << EOF
#cloud-config
hostname: $hostname
ssh_authorized_keys:
- #your ssh public key here
write_files:
- path: /etc/sysctl.d/aio-max.conf
permissions: 0644
owner: root
content: "fs.aio-max-nr = 1048576"
- path: /etc/hosts
permissions: 0644
owner: root
content: |
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
- path: /etc/environment
permission: 0644
owner: root
content: |
NAMECHEAP_URL="namecheap.com"
NAMECHEAP_API_USER="pierreo"
NAMECHEAP_API_KEY=
IP=`curl -s http://icanhazip.com/`
FirstName="Pierre"
LastName="Ozoux"
Address="23CalcadaSaoVicente"
PostalCode="1100-567"
Country="Portugal"
Phone="+351.967184553"
EmailAddress="pierre@ozoux.net"
City="Lisbon"
CountryCode="PT"
BACKUP_DESTINATION=root@xxxxx:port
MAIL_USER=contact%40indie.host
MAIL_PASS=
MAIL_HOST=mail.indie.host
MAIL_PORT=587
coreos:
update:
reboot-strategy: off
units:
- name: systemd-sysctl.service
command: restart
- name: data.mount
command: start
content: |
[Mount]
What=/dev/md0
Where=/data
Type=ext4
- name: swap.service
command: start
content: |
[Service]
Type=oneshot
ExecStart=/sbin/swapon /swap
EOF
# Create Directory structure
git clone https://github.com/indiehosters/LibrePaaS.git /indiehosters
mkdir /{data,system}
mkdir /data/trash
# Install unit-files and utils
cp /indiehosters/unit-files/* /etc/systemd/system && systemctl daemon-reload
cp /indiehosters/utils/* /opt/bin/
mkdir -p /opt/bin
DOCKER_COMPOSE_VERSION=1.6.0
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment