Experiment with Raspberry PI 4 – Dockerize IoT!

Hardware:
– RPI 4, 4GB
– 250 GB SSD: Teamgroup PD400
– MicroSD 32 GB

Attempt 1:

OS: Raspbery Pi OS Lite 2021-10-30

First I made sure SSH is avalble to me so I could login through my PC notebook.

Then:

$ sudo apt update
$ sudo apt upgrade -y

RESTART

after restart I SSH in and run the following:

  1. Install curl:
$ sudo apt install -y curl

2) Run the following command:

$ curl -fsSL https://raw.githubusercontent.com/SensorsIot/IOTstack/master/install.sh | bash

This runs takes down a github repository IOStack and runs it. Some restarting might be in order after Docker is installed.

Will it work?

Well… containers are there…

But how about their fuctions? Are they properly installed?

These are the containers I have built and intend to test now:

Nextcloud problem!

I create an admin account. I try to login with it… and I can’t.

Solution:

  1. Be in the correct directory:$ cd ~/IOTstack
  2. If the stack is running, take it down:$ docker-compose down
  3. Erase the persistent storage area for Nextcloud (double-check the command before you hit return):$ sudo rm -rf ./volumes/nextcloud This is done to force re-initialisation. In particular, it gives you assurance that the passwords in your docker-compose.yml are the ones that are actually in effect.
  4. Bring up the stack:$ docker-compose up -d
  5. Check for errors:Repeat the following command two or three times at 10-second intervals:$ docker ps You are looking for evidence that the nextcloud and nextcloud_db containers are up, stable, and not restarting.
  6. then make your domain name by running raspi-config . Let’s say you chose ‘rpi4’ which would make the url to nextcloud the follwoing: rpi4:9321
  7. then.. stop docker again and go edit the file ~/IOTstack/volumes/nextcloud/html/config/config.php
  8. search for trusted_domains and add the new domain so it looks something like this:
    ‘trusted_domains’ => array (
    0 => ‘192.168.203.200:9321’,
    1 => ‘rpi4.local:9321′,
    2 => ‘rpi4:9321′,
    ),
  9. Save the damn file and go:
    cd ~/IOTstack
    …and then…
    docker-compose restart nextcloud
  10. open browser at rpi4:9321 and the registration and login should finally work
Nexcloud works!

You’re efing welcome!

Share if thou wilt!

Published by hoornet

Working as Visual C++ developer with IDE from actual previous millennia. As a hobby, working on Android development with Kotlin. Lately trying to move to Flutter.

Leave a comment

Your email address will not be published.

%d bloggers like this: