Execute the following commands in a bash shell.
Initialize the following variables:
network={eth0|wlan0} // Ethernet or wireless respectively
ip={ip} // static IP address for the Raspberry Pi
routerIp={routerIp} // the gateway IP address for your router on the local network. Typically 192.168.0.1
dnsIp={dnsIp} // the DNS IP address (typically the same as your router’s gateway address)
ocisVersion={ocisVersion} // the version of ocis e.g. 1.16.0
E.g.
network=wlan0
ip=192.168.0.154
routerIp=192.168.0.1
dnsIp=192.168.0.1
ocisVersion=1.16.0
Helpful commands:
hostname -I
- Returns currently assigned IP.ip route | grep default | awk '{print $3}'
- Returns Router IP
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install etcd -y
echo 'ETCD_UNSUPPORTED_ARCH=arm' | sudo tee -a /etc/default/etcd
sudo service etcd start
sudo curl "https://download.owncloud.com/ocis/ocis/${ocisVersion}/ocis-${ocisVersion}-linux-arm" --output /usr/bin/ocis
sudo chmod 755 /usr/bin/ocis
sudo install -D /dev/null /etc/systemd/system/ocis.service
lines=('[Unit]' 'Description=OCIS server' '' '[Service]' 'Type=simple' 'User=pi' 'Group=pi' 'EnvironmentFile=/etc/ocis/ocis.env' 'ExecStart=ocis server' 'Restart=always' '' '[Install]' 'WantedBy=multi-user.target')
for line in "${lines[@]}"; do echo $line | sudo tee -a /etc/systemd/system/ocis.service; done
sudo install -D /dev/null /etc/ocis/ocis.env
lines=('PROXY_HTTP_ADDR=0.0.0.0:9200' "OCIS_URL=https://${ip}:9200" 'OCIS_INSECURE=true' 'KONNECTD_TLS=0')
for line in "${lines[@]}"; do echo $line | sudo tee -a /etc/ocis/ocis.env; done
Run systemctl enable --now ocis
and access ownCloud locally or remotely on https://{ip}:9200 with the credentials:
User: admin
Password: admin
Note: If you need to restart oCIS because of configuration changes in /etc/ocis/ocis.env
, run systemctl restart ocis
.
Warning: After running the commands in this section, the Raspberry Pi will not be able to access the Internet. To undo this operation, delete the appended configurations in /etc/dhcpcd.conf
and run sudo reboot
.
lines=("interface ${network}" "static ip_address=${ip}/24" "static routers=${routerIp}" "static domain_name_servers=${dnsIp}")
for line in "${lines[@]}"; do echo $line | sudo tee -a /etc/dhcpcd.conf; done
Then, run sudo reboot
.