Skip to main content

Getting started with Docker on a Linux Server

This tutorial will guide you through the steps needed to install and run ionflow using Docker.

Step 1. Install Docker

Before you can run Ionflow using Docker, you will need to have Docker installed on your Linux machine. If you are not sure if Docker is installed, you can run the following command to check:

docker --version

If Docker is not installed, you can follow the instructions on the Docker website to install it.

Step 2. Download the Ionflow Docker Image

To run Ionflow using Docker, you will need to download the Ionflow Docker image from the Container Repository. You can download the image using the docker pull command, for example:

docker pull ghcr.io/kuberkai/ionflow-server:latest

This will download the latest version of the Ionflow Docker image from the repository.

!!! tip If you want to download a specific version of the Ionflow Docker image, you can replace :latest with the version number, for example:

```bash
docker pull ghcr.io/kuberkai/ionflow-server:1.0.0
```

Step 2. Prepare The Environment

To prepare for installation, you will need to create the required directories and a user called "ionflow" that will own them. Here are the steps to do this:

  1. Open a terminal window and switch to the root user by running the following command:
sudo su
  1. Create the directories that will be used by ionflow by running the following commands:
mkdir -p /var/lib/ionflow/ionbay /var/lib/ionflow/ionrow /var/lib/ionflow/kutlass
chmod 755 /var/lib/ionflow/ionbay /var/lib/ionflow/ionrow /var/lib/ionflow/kutlass
  1. Create a user called "ionflow" that will own the directories created in step 2

    Before running the useradd command to create the "ionflow" user, you may want to check if the user already exists. You can do this by running the id ionflow command. If the user already exists, you can skip the useradd step and proceed to step 4.

    Assuming the user doesn't exist run the following:
useradd -d /var/lib/ionflow -s /bin/false ionflow

This will create a user called "ionflow" with the specified home directory and shell.

  1. Change the ownership of the directories created in step 2 to the "ionflow" user by running the following commands:
chown -R ionflow:ionflow /var/lib/ionflow

This will recursively change the ownership of all files and directories under /var/lib/ionflow to the "ionflow" user and group.

Step 3. Setup a Configuration File

Download the sample configuration

You will want to setup a configuration file for running Ionflow with system specific options. There is a sample configuration which can be found here.

Review the options

Review the configuration options in the file and make any necessary changes. For example, you may want to specify the address and port that the Ionflow server will listen on, or you may want to configure the database connection details.

!!! warning Note: The sample configuration file contains default values that may not be appropriate for your system. Please review the configuration file and modify it as needed before starting the Kuberkai/ionflow software.

Place the file

Copy the configuration file to the correct location on your Linux machine. The instructions below specify that the configuration file should be saved at /etc/ionflow/ionflow.yaml.

Step 4. Start Ionflow

Run the following commands to start the ionflow server in a docker:

docker run \
-v /var/lib/ionflow/ionbay:/var/lib/ionflow/ionbay \
-v /var/lib/ionflow/ionrow:/var/lib/ionflow/ionrow \
-v /var/lib/ionflow/kutlass:/var/lib/ionflow/kutlass \
-v /etc/ionflow/ionflow.yaml:/etc/ionflow/ionflow.yaml \
ghcr.io/kuberkai/ionflow-server:latest \
ionflow server -c /etc/ionflow/ionflow.yaml

!!! tip

All configuration options can be set via environment variables e.g. 

``` bash
docker run \
-v /var/lib/ionflow/ionbay:/var/lib/ionflow/ionbay \
-v /var/lib/ionflow/ionrow:/var/lib/ionflow/ionrow \
-v /var/lib/ionflow/kutlass:/var/lib/ionflow/kutlass \
-v /etc/ionflow/ionflow.yaml:/etc/ionflow/ionflow.yaml \
-e IONFLOW_HTTP_LISTEN_ADDR=:8888 \
ghcr.io/kuberkai/ionflow-server:latest \
ionflow server
```