Skip to content

IIAB Installation

A Holt edited this page Jan 1, 2024 · 298 revisions

Installing Internet-in-a-Box (IIAB)

Quick Links

Overview

Our 1-line installer at download.iiab.io is all you need to get started!

Or, if you prefer to do a fully manual install, continue reading below. Either way, building an Internet-in-a-Box (IIAB) server involves these 3 steps:

  1. Configure /etc/iiab/local_vars.yml (choose apps/services, etc)
  2. Install the Software
  3. Add Content

We've come a long way since our installation video from 2019-02-14.

Building your own DIY Library of Alexandria is one of the most valuable gifts you can offer to your community! As you do this, we strongly encourage you to get in touch with our global volunteer community network (http://OFF.NETWORK) such that the very best learning content is increasingly available to deserving minds of all ages, in ALL countries!

Thank you for taking Digital Libraries seriously for one & all!

Expert Mode

This is for people who already know how to do everything in these instructions and enjoy doing them multiple times by missing the nuances that make this install different from things they have done before. If you are an expert, at least read about PARTITIONING as so many miss this part. Reading about networking will probably come in handy as well.

Install the Software

There are basically three ways to install IIAB software:

  1. Strongly Recommended in 2023: use our new 1-line installer script which does essentially everything!
  2. Do everything from scratch, manually, following the instructions below.
  3. Take a short cut if you have access to an IIAB "image" file from someone else who did everything from scratch, or at least some of the steps.

The advantage of doing everything from scratch is that you will get exactly what you want, and learn about the inner workings of Internet-in-a-Box. (The disadvantage is that it's more work!)

Do Everything from Scratch

Here is the complete list of the steps required. Some may already be done.

  1. Assemble your hardware with your chosen amount of RAM, storage, and network devices. See IIAB Platforms for the partitioning scheme and IIAB Networking overview.

    Traditionally we use Standard partitioning, but increasingly since 2017 LVM partitioning is possible as well. In any case, the above "IIAB Platforms" document is the place to start for all partitioning tips.

  2. Install a minimal version of your OS (installing ssh is fine, but avoid installing Apache/NGINX or most anything else, as these will be installed for you later!)

    WARNING: OTHER LINUX DISTRIBUTIONS MAY NOT/YET WORK!

  3. While installing over Wi-Fi is possible, an Ethernet (live Internet) cable is strongly recommended during installation!

    If you have no choice but to install over Wi-Fi, you can run sudo raspi-config (on Raspberry Pi OS) > Network Options > Wi-Fi to set the SSID and passphrase that will get you on the Internet (this happens in /etc/wpa_supplicant/wpa_supplicant.conf). Then do sudo reboot and verify your Internet connection.

    No matter what your OS, log into your machine with an attached monitor/keyboard or via ssh. Before proceeding, verify your Internet connection by typing:

   ping mit.edu
  1. Verify you don't have an old/troublesome version of Ansible installed!

    Read "What is Ansible and what version should I use?" within FAQ.IIAB.IO (or suffer the consequences :-)

  2. Escalate to root using "sudo su -" or similar. If you prefer to use "sudo" with each of the commands below, that is OK too.

  3. Run these commands:

   apt update
   apt -y dist-upgrade
   apt -y autoremove

   reboot

   apt -y install git

   mkdir -p /opt/iiab
   cd /opt/iiab/
   git clone https://github.com/iiab/iiab
   git clone https://github.com/iiab/iiab-admin-console
   git clone https://github.com/iiab/iiab-factory

   mkdir -p /etc/iiab/
   cd /opt/iiab/iiab/vars/
   # cp local_vars_small.yml /etc/iiab/local_vars.yml
   cp local_vars_medium.yml /etc/iiab/local_vars.yml
   # cp local_vars_large.yml /etc/iiab/local_vars.yml

   # PLEASE EXAMINE local_vars.yml CAREFULLY (AND MODIFY AS NEC) *BEFORE*
   # RUNNING ./iiab-install (BELOW) AS THIS CAN TAKE A COUPLE HOURS!

   # NOTE: you can change many/most settings after install too, using the
   # Admin Console (http://box.lan/admin) as documented at: http://FAQ.IIAB.IO

   cd /opt/iiab/iiab/scripts/
   ./ansible
   # Installs latest Ansible and ~4 Ansible Collections

   cd /opt/iiab/iiab/
   ./iiab-install
   # TRY TO RERUN THE ABOVE LINE IF IT FAILS (if networking glitches etc?)

   cd /opt/iiab/iiab-admin-console/
   ./install
   # Installs Admin Console; runs iiab-get-kiwix-cat to d/l Kiwix catalog
   # Installs Dynamic Menuing for /library/www/html/home/index.html

STRONGLY RECOMMENDED: The above commands all happen automatically if you run our 1-line installer, which allows you to choose a preset number of server apps: (~6 server apps, ~12 server apps, or ~30 server apps)

   curl iiab.io/install.txt | bash

This 1-line installer requires the latest Raspberry Pi OS (on Raspberry Pi 3, 3 B+, 4, 400 or 5) — or Ubuntu 22.04+, Mint 21+ or Debian 12+ (on x86_64 PC's). Note the above can take more than an hour on a Raspberry Pi (even with a fast Internet connection) so if you want to get moving faster, stick with a SMALL-sized or MEDIUM-sized install. Conversely a much larger but slower installation is possible ("LARGE-sized") if you want to experiment with the more full suite of ~30 server apps. Please review the comparison table to help you make your choice.

Finally, please browse our install script to inspect and learn from the automated steps of the bash-driven installation process, and please write to bugs @ iiab.io if you find issues, Thank You !

In general, beware ./iiab-install runs slowly (1) the 1st time you run it (2) if you permit your Raspberry Pi CPU to rise above 80C on a hot day without active ventilation (3) if you're using a slower/older SD card and/or (4) if you have a slow Internet connection.

Whereas subsequent runs (e.g. via Admin Console > Configure > Install Configured Options) run quickly, sometimes completing in as little as 5-to-10 minutes on a modern Raspberry Pi.

A reboot is generally necessary before IIAB becomes fully functional, e.g. to put Hostname change into effect, etc.

You can see the log of the last install by typing:

   more /opt/iiab/iiab/iiab-install.log

Proceed to: Configure the Server

Take a Short Cut

If you want to install a pre-built disk image (ISO file, .img file or similar) onto a Raspberry Pi microSD card, follow these instructions: https://github.com/iiab/iiab/wiki/Raspberry-Pi-Images-~-Summary

Tools

For the latest, please also see "How do I back up, shrink & copy IIAB microSD cards?" at FAQ.IIAB.IO

  • Windows

    • Raspberry Pi Imager — friendly way to burn/flash an image, directly from the Internet to your microSD card
    • Etcher or Win32 Disk Imager — burn/flash an image onto a microSD card
    • 7-Zip — unpacks compressed files of almost any kind
    • FileZilla or WinSCP — if {SCP, FTP, FTPS, SFTP} are needed to download/upload
  • Linux and macOS

    • Raspberry Pi Imager — friendly way to burn/flash an image, directly from the Internet to your microSD card
    • Etcher — burn/flash an image onto a microSD card
    • dd — command-line "data duplicator"
    • tar, unzip, gunzip, bzip2, xz — unpack compressed files & archives

Raspberry Pi 3, 3 B+, 4, 400 or 5

We recommend you install the latest version of Raspberry Pi OS (Lite version, or with desktop — the 64-bit version if possible).

WARNING: IIAB DOES NOT SUPPORT THE NOOBS OS!

Since 2021, IIAB can also be installed (experimentally) on Ubuntu on Raspberry Pi.

Either way, please review the latest OS recommendations! Then, after you've installed your chosen OS, proceed to install IIAB from https://download.iiab.io

Mini PC's like Intel NUC and Gigabyte BRIX

Note that most Intel NUCs (Next Unit of Computing) shipping since 2015, including the 5th and 6th generation Intel NUC's, have a soldered-in Wi-Fi chip limited to 12 clients maximum. Its competitor the Gigabyte BRIX suffers from the same limitation out of the box (factory units arrive with an Intel Wi-Fi module) but thankfully this Wi-Fi module is removable! Specifically, the Gigabyte BRIX's Wi-Fi socket has been tested to accept less-constrained Wi-Fi cards, such as Atheros modules available for less than $10.

If you are given a pre-built x86 image, it should generally install via Clonezilla when booted on the target machine.

The image (ending in .img) should be written to a USB stick using the same software as for Raspberry Pi and OLPC XO laptops.

Note that these images will write two partitions to a USB stick (thumb drive). The first partition contains the Clonezilla tool, which uses the data from the second partition to initialize your hard disk.

Finally, while these images have been developed on the Intel NUC, they may well work on other Intel machines too (do let us know!)

Configure Your IIAB Server

At this point you should be able to connect to http://box from a browser. In certain cases http://box.lan, http://schoolserver.lan, http://localhost or http://10.10.10.10 may instead be needed.

To begin configuring the server, connect to its Admin Console at http://box.lan/admin (username: iiab-admin password: g0adm1n -- note the numbers 0, 1). In general, all default/initial passwords are documented at "What are the default passwords?" within: FAQ.IIAB.IO

This permits selection of options, services, languages, etc to permit additional services, and educational resources to be enabled and selected for download.

Please click on the Help link to get detailed information on configuration options.

If you're new to Admin Console, please read "What are the default passwords?" in FAQ.IIAB.IO

Server Security

The first time you sign into the Admin Console would be the best time to change the password. Select the Utilities menu option and the first item, change password. Fill in the form and click Change Password.

Please also read about and take seriously Internet-in-a-Box security practices.

Configure Menu

Once the password has been set you should start with the Configure menu item. The overall process is:

  1. Select each sub-menu item and enter any desired parameters. Help is available for each screen and parameter.
  2. Click Save Configuration
  3. Click Install Configured Options
  4. Monitor the progress of the Configuration job in Utilities > Display Job Status.
  5. Note that after Display Job Status shows "Success", it may be necessary to reboot, to enable all the selected changes.

This job can take a substantial amount of time depending on the capacity of the platform involved and how much of the software was included in the initial image.

Proceed to: Add Content

Supported Network Modes

Operator can select one of three modes of operation:

  • Appliance - No firewall, no dhpcd, no DNS, just a contributor to an already existing network.
  • Gateway - Issues IP addresses (dhcpd or similar), name lookup (DNS), firewall, local web page cache for faster retrieval the second time, content filtering to reduce porn (DansGuardian), and site "whitelists" if wanted.
  • LAN Controller (Local Area Network) - In this mode, the server configures clients with IP addresses (e.g. dhcpd - dynamic host configuration protocol), name resolution (defines "box" and "schoolserver" for all clients, etc).

Based upon selection of the above mode in the Admin Console, IIAB's network role will attempt to set up network connections. If "Appliance" mode is wanted, the network adapter will be set up. If "Gateway" is selected, and one of the adapters discovers that it is connected to a source of IP addresses, that adapter will be the internet, and the other the Wi-Fi connector. If "LAN Controller" is selected, any adapter found will be act as server to any clients that might ask to connect.

The IIAB installation attempts to determine the network topology based on the number and types of connections it discovers. In general, it looks to see if there is a connection to a gateway and whether other wireless or wired connections are present.

Enable Services

It's best to choose your IIAB Apps (services) prior to installing IIAB, by configuring /etc/iiab/local_vars.yml, as the 1-line installer asks you to do.

Some of these apps/service can also be enabled after IIAB software is installed, by checking boxes in Admin Console (http://box.lan/admin) > Configure menu > Enable Services.

If you attempt this, remember to then click Save Configuration > Install Configured Options.

Finally, confirm that it has completed in the coming minutes, within Utilities > Display Job Status > Refresh Status.

If you're new to the Admin Console, please read "What are the default passwords?" in FAQ.IIAB.IO

Add Content

Please see "How do I customize my Internet-in-a-Box home page?" at FAQ.IIAB.IO and watch the HOW-TO videos on Internet-in-a-Box's YouTube channel (several available as .mp4 and .webm) to get moving downloading & arranging content on your IIAB (Internet-in-a-Box).

Since IIAB/XSCE 6.0, many kinds of content can be downloaded and installed through your IIAB server's Admin Console (http://box.lan/admin).

WARNING: some of these Content Packs are quite large and you should pay attention to the space available and space required displayed on each screen. Note that space calculations may not reflect multiple types of downloads happening simultaneously.

Add with Admin Console

To begin, log in to your IIAB's Admin Console (http://box.lan/admin), click Install Content, and view relevant Help.

ZIM Files

ZIM files (ZIMs) are compressed and indexed (rapidly searchable) Content Packs, generally prepared by https://kiwix.org. They include Wikipedia, Wiktionary, TED Talks, and many other educational/reference materials in multiple languages. Download and install these as follows:

  1. Within Admin Console > Install Content, hit button Refresh Kiwix Catalog to update your list of available ZIM files with the very latest from Kiwix.org.

  2. Within Install Content, click Get ZIM Files from Kiwix. Before making your selection of ZIM files, use buttons Select Languages > More Languages to be sure you're viewing all relevant choices, in many more languages than just {English, Spanish, French, Portuguese, Arabic and Hindi}.

  3. Carefully finalize your selection of ZIM files, among the many choices. Avoid downloading/installing more than 10 at once!

  4. Click button Install Selected ZIMs to begin downloading and installing them onto your server. This can take a very long time, during which time your server may appear unresponsive (within the first hour especially) while it's working!

  5. Monitor progress within Admin Console > Utilities > Display Job Status. Each ZIM file spawns 3 jobs which (1) download, (2) unzip, then (3) move the pieces into position within /library/zims/content and /library/zims/index. In the past, after installing ZIM files, you also needed to run "iiab-make-kiwix-lib; systemctl restart kiwix-serve" — but this is no longer necessary since IIAB/XSCE 6.2.

WARNING: there are certain situations (particularly if you've removed a ZIM file from /library/zims/content, e.g. to clean house or when a malformed ZIM file failed to install its index) where you need to run Admin Console > Install Content > Restart Kiwix Server. This will fix the listing within the above "Get ZIM Files from Kiwix" downloader, so it correctly shows which ZIM files you truly have installed (and which others are truly downloadable!)

Reminder: you can always click Help near the top-right on any page within IIAB's Admin Console, then click on help section Install Content.

OER2Go (RACHEL) Modules

RACHEL maintains a large number of Content Packs at https://rachel.worldpossible.org/content. They include HTML, PDF, and other web materials in multiple languages. Download and install these as follows:

  1. Within Admin Console > Install Content, hit button Refresh OER2Go Catalog to update your list of available modules.

  2. Within Install Content, click Get OER2Go(RACHEL) Modules. Before making your selection of modules, use buttons Select Languages > More Languages to be sure you're viewing all relevant choices, in many more languages than just {English, Spanish, French, Portuguese, Arabic and Hindi}.

  3. Carefully finalize your selection of OER2Go modules, among the many choices. Avoid downloading/installing more than 10 at once!

  4. Hit button Install Selected Modules to begin downloading and installing them onto your server. This can take a very long time, during which time your server may appear unresponsive (within the first hour especially) while it's working!

  5. Monitor progress within Admin Console > Utilities > Display Job Status. Each module spawns 2 jobs which (1) download, then (2) move the pieces into position within /library/www/html/modules.

Reminder: you can always click Help near the top-right on any page within IIAB's Admin Console, then click on help section Install Content.

KA Lite (for Khan Academy)

KA Lite is the most popular platform to experience Khan Academy videos, and a huge collection of associated exercises. Accounts may be created for students and teachers if you choose to use KA Lite's LMS functionality as well, to track your own progress (or others').

To download the Khan Academy videos of your choosing, in various languages, use KA Lite's downloader available in these places:

Username/password is Admin/changeme upon installation.

KA Lite's English exercises and subtitles (about 1 GB) MUST be downloaded and installed, even if you are not using English videos, starting with KA Lite 0.17.0 early in 2017. Thankfully IIAB's 1-line install script installs this essential piece for you.

See also "KA Lite Administration: What tips & tricks exist?" within FAQ.IIAB.IO.

Add Content Manually

OER2Go (RACHEL) Modules

Download OER2Go (RACHEL) modules manually using rsync, to /library/www/html/modules

After a module has been downloaded successfully (rerun rsync if there are connectivity issues) local/offline users can access it with URL:

   http://box.lan/modules/<module-name>

Copy KA Lite Videos

If KA Lite videos have been obtained from another install or on some storage medium they can be copied directly to KA Lite without going through the admin interface.

  1. Copy to /library/ka-lite/content/
  2. Issue the command systemctl restart kalite-serve to restart the server

OpenStreetMap

OpenStreetMap.org (OSM) is much like Google Maps, but more democratic and without advertising — anybody can change it, much like Wikipedia only for maps.

Internet-in-a-Box enables OSM to be viewable, zoomable and searchable while offline.

NEW WAY 2018: Please read "How do I add zoomable maps for my region?" at FAQ.IIAB.IO to install compact vector-based maps that include the full detail for your region.

OLD WAY 2017 / SIMPLE ALTERNATIVE: Consider downloading the 10-layer en-worldmap-10 (10.7GB) to /library/www/html/modules in a pinch, if you're running our of time, as the download is all you need to make basic maps happen. The Catch: this download can take hours, as it includes a huge number of small files.

OLD WAY: 16 levels of zoom are possible, from level 0 to 15 using the bitmap (raster) tiles generating by IIAB starting in 2013. This is about 110GB total, so you may need to obtain a physical drive by working with volunteers at unleashkids.org e.g. if the levels posted to download.iiab.io/content are insufficient for your needs.

Either way, the following directories and their contents are needed:

  • /library/knowledge/modules/geonames_index
  • /library/knowledge/modules/openstreetmap

Implementers can reduce OSM's storage needs by eliminating high-zoom levels within directory openstreetmap, where each zoom level is contained within its own subdirectory.

Example 1: newer install images typically include layers 0 to 8 (140MB) fully working out-of-the-box, even prior to your customizing your own Internet-in-a-Box server.

Example 2: osm12.tar.gz from download.iiab.io/content includes layers 0 to 12 (8.2GB) showing many towns/rivers/parks worldwide, not just cities/countries/seas.

As you can see, each increasing zoom level generally requires exponentially ever larger amounts of storage!

ASIDE: there is a very dedicated group of people coming together to improve the quality, compactness, vividness, searchability (and UX) of OpenStreetMap for the entire developing world in 2017. Please do make contact with holt @ laptop.org if you too can help here.

Local Content

Schools/Clinics often have custom learning materials they want "permanently" shared with everyone on site. Such PDF's, DOC files, videos, images, audio recordings and HTML (etc!) can be copied to /library/www/html/local_content so that users can browse it, with a URL like http://box/usb or http://box.lan/usb

External USB/Drive Content

For spontaneous (ad hoc) access to materials and teacher content (handouts, lessons, etc) these can be placed on a USB stick or drive, within a folder named:

  • usb

...which will appear under URL http://box/usb or http://box.lan/usb when teachers' sticks/drives are plugged into the server's USB ports. Warning: some older phones/devices may require you to type in http://box.lan/usb or http://10.10.10.10/usb

For legacy support of the LibraryBox and PirateBox communities, teachers may also place shareable content in folder names {share, Share, Pirateshare/Share} on their USB sticks/drives.

Bonus: after the lesson, teachers should feel free to remove their USB sticks/drives without warning, as the IIAB server should unmount USB sticks/drives automagically.

See "Can teachers display their own content?" within our Frequently Asked Questions (FAQ.IIAB.IO) and "usb_lib README" for more info.

Remove Content

IIAB 6.5 introduced this curatorial productivity tool, to free up space on your Internet-in-a-Box, allowing you to select and remove stale content. This can be an absolute lifesaver prior to updating to new content.

After you log into IIAB's Admin Console (http://box.lan/admin) click Install Content, then Remove Content. A list will appear showing content packs / modules installed on your IIAB.

Use the checkboxes to select those older-or-unneeded ZIM files and OER2Go (RACHEL) modules that you want to remove.

Then click Delete Checked Files at the top of the page!

Reminder: you can always click Help near the top-right on any page within IIAB's Admin Console, then click on help section Install Content.

Clone this wiki locally