Skip to main content

Morio Installation Guide

This guide covers the various ways you can install Morio, from fully automated, to completely manual.

Before you start​

Morio collector vs Morio client​

This guide covers the installation of a Morio collector, also known as moriod.

For installation of the Morio client, please refer to the Morio client install guide.

Morio Release Channels​

Morio releases are provided through different channels that each serve their specific purpose. You should use the production channel unless you have specific reasons not to.

πŸ“¦ Production

The production channel provides stable releases that have been tested and gone through an incubation period in the canary channel.

This is the default channel. Use this channel unless you have specific reasons not to.

🐣 Canary

The canary channel provides early access to releases. When no issues come up during a canary release's incubation period, it is promoted to production.

The canary releases allows you to test an upcoming production release in your specific environment, and limits the blast radius in case a problem is not caught in testing. For this reason, we recommend to run the canary release on a staging instance.

πŸ’£ Testing

The testing channel is not intended to be used for real deployments. Instead, this channel is used for our integration tests, as well as by developers of and contributors to Morio to validate fixes or new features.

When a release in testing is validated, it graduates to canary.

Filesystem Layout​

Morio utilises one folder for configuration, one for data, and another one for its logs. By default, they are laid out as such:

In addition, Morio needs access to the Docker socket. See the MORIO_DOCKER_SOCKET for details.

Install Morio​

There are 3 ways to install Morio, and a bonus fourth way allows you to run it without any install step:

Install Morio via the installer script​

tip

This is the recommended way to install a Morio node.

To install Morio, run this command as a user with sudo permissions:

curl https://install.morio.it/ | bash

This will run through the following steps:

Alternatively, you can run all of these steps manually, as outlined below.

Install Morio from packages​

To install Morio from packages, we will go through the same steps as the install script, but instead run them by hand:

Ensure systemd is available​

To install Morio using our packages, systemd is a dependency.

Make sure your system has systemd by running:

systemctl -h

If you get a bunch of output on how to use systemctl, you have systemd.

tip

If you do not have systemd on your system, you can still do a fully manual install of Morio.

Determine the package type​

We provide .deb packages for APT-based systems, like Debian or Ubuntu, as well as .rpm packages for RPM-based systems like RedHat, RockyLinux, or Fedora.

apt -h

If you get a bunch of output about the apt packages manager, you are on an APT-based system. If not, you are probably on an RPM-based system.

Download and install the moriod-repo package​

Download the moriod-repo package, and then install it:

curl https://apt.repo.morio.it/setup-moriod-repo.deb -o ./setup-moriod-repo.deb
sudo apt install -y ./setup-moriod-repo.deb

The first line downloads the package, from these URLS:

The second line installs it.

Update the list of available software​

The moriod-repo package we just installed adds a new software repository. Before we can install software from it, we need to update the list of available packages:

sudo apt update

Install the moriod package​

Now we can install the moriod package:

sudo apt install -y moriod

This will create a new systemd service that will start Morio.

Install Morio by hand​

Installing Morio by hand gives you even more control, and allows installing Morio on systems that do not support APT or RPM packages, or do not use systemd.

Let’s see how we can accomplish that.

Create folder structure​

You’ll need to create Morio’s Filesystem Layout. To do so, you can run these commands:

sudo mkdir -p /etc/morio/moriod
sudo mkdir -p /var/lib/morio/moriod
sudo mkdir -p /var/log/morio/moriod

For each of these folders, holding configuration, data, and logs respectively, you can change their location. However, if you do so, you should also update them in the commands below.

Create the moriod service​

We’ll need some way to start our moriod service. Below are options for both systemd and a traditional init script.

# /etc/systemd/system/moriod.service
[Unit]
Description=Morio distribution core service
Documentation=https://github.com/certeu/morio
# Make sure the Docker service is available
After=docker.service
Requires=docker.service

[Service]
# Make sure to stop & remove the core container if it's running
ExecStartPre=/usr/bin/docker rm -f morio-core

# Start the morio-core container
ExecStart=/usr/bin/docker run --rm \
--name=morio-core \
--hostname=core \
--label morio.service=core \
--log-driver=journald \
--log-opt labels=morio.service \
--network-alias=core \
--init \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v "/etc/morio/moriod:/etc/morio" \
-v "/var/lib/morio/moriod:/morio/data" \
-v "/var/log/morio/moriod:/var/log/morio" \
-e "MORIO_CORE_LOG_LEVEL=info" \
-e "NODE_ENV=production" \
itsmorio/core:latest

# When stopping, we stop & remove all containers as they are
# ephemeral (their data is mounted from the host disk)
# Core will recreate them when you start the service again.
# We are listing all possible serviices. Some may not exist w
# so we redirect stderr to /dev/null
ExecStop=/usr/bin/docker rm -f morio-api morio-ca morio-broker morio-db morio-console morio-ui morio-proxy morio-connector morio-dbuilder morio-watcher morio-web 2> /dev/null

# Always restart
Restart=always

# Idenitifier for syslog
SyslogIdentifier=moriod

[Install]
WantedBy=default.target

Morio is now installed, you can start the moriod service.

As a bonus, if you are running systemd, you can place this moriod script somewhere in your PATH.

Run Morio without installing it​

Last but not least, you can run Morio without installing anything.

To kick the tires, all you need to start Morio is this command:

docker run --rm --init \
--name=morio-core \
--hostname=core \
--network-alias=core \
-v "/var/run/docker.sock:/var/run/docker.sock" \
itsmorio/core:latest

If you want to clean up after stopping Morio, make sure to remove all its containers:

docker rm -f morio-core morio-api morio-ca morio-broker morio-db morio-console morio-ui morio-proxy morio-connector morio-dbuilder morio-watcher morio-web 2>/dev/null

Uninstall Morio​

To uninstall morio and remove from your system, follow these steps:

  • Stop moriod:
sudo moriod stop
  • Remove all containers with a morio- prefix:
docker rm -f morio-core morio-api morio-ca morio-broker morio-db morio-console morio-ui morio-proxy morio-connector morio-dbuilder morio-watcher morio-web 2>/dev/null
  • Remove the moriod-repo and moriod packages (if you installed using our packages):
sudo apt purge -y moriod-repo moriod
  • Remove the 3 folders holding configuration, data, and logs. If you do not have the Morio client installed, you can remove everything under morio:
sudo rm -rf /etc/morio /var/log/morio /var/lib/morio
  • If you do have the Morio client installed (and want to keep it), remove everything under morio/moriod:
sudo rm -rf /etc/morio/moriod /var/log/morio/moriod /var/lib/morio/moriod