Skip to content

Installation

Florian Quirin edited this page Sep 19, 2021 · 26 revisions

Installation

Here you will find more detailed instructions for certain platforms like the Raspberry Pi. Common instructions can be found here.

Raspberry Pi Installation via script

If you're already running a (fresh and clean) Raspbian Lite the recommended way to install SEPIA-Home server is to download the installation script and follow the on-screen instructions:

mkdir ~/tmp
cd ~/tmp
wget https://raw.githubusercontent.com/SEPIA-Framework/sepia-installation-and-setup/master/scripts/install-environment-raspbian.sh
bash install-environment-raspbian.sh

Starting from scratch

Installing a fresh Raspbian

  1. Get the latest Raspbian/Raspberry Pi OS Lite (without desktop): Download
  2. Get Etcher (portable) to flash Raspbian to your Micro-SD card (it's really easy): etcher.io
  3. Open Etcher, select the Raspbian Zip-file you've downloaded, select your Card-reader with your Micro-SD card as target and start flashing.
  4. After flashing finished remove your Micro-SD from the reader and put it back in (to reload the new file-system) then open the Micro-SD card (should be called "boot") and create an empty file called "ssh" (no file ending). This will make sure that you can login via SSH to your Pi later.
  5. Optionally you can add access to your Wifi (not-recommended for this server), here is a good blog-article about it on Medium or you can deactivate Wifi and Bluetooth to save some resources (recommended). For the latter look for a file called config.txt on your Micro-SD and add (or replace) these lines:
# Disable Wifi
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
  1. Put the Micro-SD in your Raspberry Pi 3 and plug it in (network and power).

Interlude: Getting your IP and setting up your router (optional)

If you don't know how to find out the IP address of your Rasperry Pi please see this guide about router configuration.

Setting up Raspbian to run SEPIA

  1. Do you know the IP of your Raspberry Pi? Good :-) If you don't you can try to use raspberrypi.local as address (this is the default RPi "hostname" and will point to the IP on most networks). We will use it now to connect to the RPi via SSH. To do this you'll need a SSH tool. UNIX systems like MacOS and Linux have one available out-of-the-box, Windows 10 seems to have one as well, but if you are running Windows I recommend to download Putty.
  2. Windows: Open Putty, type pi@[my-IP-I-remember] into the "Host Name" field (Port stays 22) and click "Open".
    Mac/Linux: Open a terminal an type ssh pi@[my-IP-I-remember].
  3. You should see a password prompt now. Type "raspberry" (the default password of the Pi) and your are connected :-)
  4. First we finish the configuration. Type sudo raspi-config and the Raspbian config tool will open.
  5. Use the tool to:
    • Define a new and secure password (and remember it!)
    • Expand the file system (Advanced Options -> Expand ...)
    • Since we need every bit of memory go to Advanced Options -> Memory Split and set the memory to 16MB (we don't have a display anyway ^^)
    • Finish and reboot
  6. Wait for the reboot then login to your Pi again via SSH (with your new password).
  7. We will install Java now and a few additional packages. To make life easier there is a script in the SEPIA-Home bundle that will help you set up your environment. Download it to a temporary folder using wget:
mkdir ~/tmp
cd ~/tmp
wget https://raw.githubusercontent.com/SEPIA-Framework/sepia-installation-and-setup/master/scripts/install-environment-raspbian.sh
  1. Run the script with bash install-environment-raspbian.sh and follow the required steps (you can skip the optional ones). Make sure everything completes without errors especially the part with Java, SEPIA download and SEPIA extract.
  2. Continue with step 3 (setup) of the SEPIA quick start guide. When you are done return here.
  3. Finally we take care that everything restarts properly when the Raspberry Pi boots up. To do that we add a cron-job:
crontab -e
@reboot sleep 60 && ~/SEPIA/on-reboot.sh;

Please note that the reboot script contains the important line sudo sysctl -w vm.max_map_count=262144 that is required for Elasticsearch to run stable. If you don't use this cron-jop make sure to call this line after your system boot.

We can add another cron-job (line below) that restarts the server every 2nd day at 4:30am to keep everything clean and stable (recommended):

30 4 1-31/2 * * ~/SEPIA/cronjob.sh;

If everything worked out well you should have your own SEPIA Server now, reachable from within your private network 😃 🤖

There is another tutorial on how to set up NGINX, Let's Encrypt and Duck-DNS to get a full-fledged SEPIA web-server with SSL)

Services

API-Keys

Certain services require an API-key to work like the weather forecast for example. All integrated services usually offer a free API-key for a certain number of calls. Once you've obtained such a key you need to put it inside the config file of the SEPIA assist-server and restart the server to activate it (a more convenient way using the admin web-tools is under consideration). Check out the details here: API-keys.