2016-02-11 11:19:49 +00:00
# Instructions to install LibrePaaS
## Recommendation
2016-02-25 19:07:53 +00:00
- API key on Namecheap (if you want to automatically buy domain name)
2016-02-11 11:19:49 +00:00
2016-03-24 09:51:44 +00:00
## Installation
2016-02-11 11:19:49 +00:00
2016-03-24 09:28:07 +00:00
First, you need a server.
2016-03-24 09:51:44 +00:00
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.
2016-03-24 09:28:07 +00:00
2016-03-24 09:51:44 +00:00
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.
2016-02-11 11:19:49 +00:00
2016-07-28 10:59:17 +00:00
- If you use a cloud provider that support `user_data` , just copy the file bellow.
- If not, use boot a live cd, and issue that command:
```
wget https://raw.github.com/coreos/init/master/bin/coreos-install
bash coreos-install -d /dev/sda -c cloud-config.tmp
```
*Don't forget to change the hostname and your ssh key!*
2016-03-24 10:37:15 +00:00
2016-02-11 11:19:49 +00:00
```
#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: swap.service
command: start
content: |
2016-03-24 09:51:44 +00:00
[Unit]
Description=Turn on swap
2016-02-11 11:19:49 +00:00
[Service]
Type=oneshot
2016-03-24 09:51:44 +00:00
RemainAfterExit=true
ExecStartPre=-/bin/bash -euxc ' \
2016-03-24 10:20:38 +00:00
fallocate -l 8192m /swap & & \
chmod 600 /swap & & \
2016-03-24 09:51:44 +00:00
mkswap /swap'
2016-02-11 11:19:49 +00:00
ExecStart=/sbin/swapon /swap
2016-03-24 09:51:44 +00:00
ExecStop=/sbin/swapoff /swap
[Install]
WantedBy=local.target
- name: install-compose.service
command: start
content: |
2016-03-24 10:20:38 +00:00
[Unit]
2016-03-24 09:51:44 +00:00
Description=Install Docker Compose
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
2016-03-24 10:20:38 +00:00
mkdir -p /opt/bin & & \
url=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r \'.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))\') && \
curl -L $url > /opt/bin/docker-compose & & \
2016-03-24 09:51:44 +00:00
chmod +x /opt/bin/docker-compose'
- name: install-indiehosters.service
command: start
content: |
2016-03-24 10:20:38 +00:00
[Unit]
2016-03-24 09:51:44 +00:00
Description=Install IndieHosters
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
2016-03-24 10:20:38 +00:00
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 & & \
2016-03-24 09:51:44 +00:00
cp /indiehosters/utils/* /opt/bin/'
```
2016-03-24 10:37:15 +00:00
And voila, your firet LibrePaaS node is ready!