Skip to main content
This guide covers installing the Motia CLI and iii engine, the two core components needed to build Motia applications.

Overview

Motia consists of:
  1. Motia CLI - Project scaffolding and development tools
  2. iii Engine - Rust-based runtime for HTTP, queues, cron, streams, and observability
The CLI automatically installs the iii engine when you create your first project, but you can also install them separately.

System Requirements

Required

  • Node.js 18+ (for TypeScript/JavaScript)
  • macOS, Linux, or WSL2 (Windows via WSL)
  • curl or Homebrew

Optional

  • Python 3.10+ (for Python Steps)
  • Redis 6+ (for queues and streams)
  • Docker (for containerized deployments)

Installing Motia CLI

1

Add Motia tap

brew tap MotiaDev/tap
2

Install CLI

brew install motia-cli
3

Verify installation

motia-cli --version

Option 2: Shell Script (Linux/macOS/WSL)

The shell script automatically detects your platform and installs the CLI:
curl -fsSL https://raw.githubusercontent.com/MotiaDev/motia-cli/main/install.sh | sh
The installer places the CLI in /usr/local/bin by default. You may need sudo permissions.

Option 3: Manual Download

Download the latest release for your platform:
curl -L https://github.com/MotiaDev/motia-cli/releases/latest/download/motia-cli-macos-arm64 -o motia-cli
chmod +x motia-cli
sudo mv motia-cli /usr/local/bin/

Installing iii Engine

The iii engine is automatically installed when you run motia-cli create, but you can also install it separately: The iii engine will be installed automatically when you create your first project:
motia-cli create my-app
# iii engine automatically installed during setup

Manual Installation

If you need to install the iii engine separately:
curl -fsSL https://install.iii.dev/iii/main/install.sh | sh
curl -fsSL https://install.iii.dev/iii/main/install.sh | BIN_DIR=$HOME/.local/bin sh

Verify iii Engine Installation

command -v iii && iii --version
Expected output:
/usr/local/bin/iii
iii v0.6.3

Installing Motia Packages

Depending on your language choice, install the appropriate Motia package:
npm install motia
The package includes:
  • Type definitions for Steps
  • iii-sdk for engine communication
  • Build tools and CLI

Installing Redis (Optional)

Redis is required for queue and stream features. If you don’t need these features, you can skip this step.

Verify Redis Connection

redis-cli ping
Expected output: PONG

Creating Your First Project

Now that everything is installed, create your first Motia project:
motia-cli create my-first-app
The CLI will prompt you to:
1

Choose a language

Select TypeScript, JavaScript, or Python
2

Pick a template

Options:
  • Basic - Minimal starter with one Step
  • Todo App - Complete CRUD example
  • Custom - Empty project
3

Install dependencies

The CLI automatically installs package dependencies

Project Structure

After creation, your project will have this structure:
my-first-app/
├── steps/                    # Your Step files
│   ├── hello-api.step.ts    # Example HTTP Step
│   └── process-hello.step.ts # Example Queue Step
├── iii-config.yaml          # iii engine configuration
├── package.json             # Dependencies (Node.js)
├── tsconfig.json            # TypeScript config (if using TS)
├── .env                     # Environment variables
├── .gitignore
└── README.md
For Python projects:
my-first-app/
├── steps/
│   └── hello_api_step.py
├── iii-config.yaml
├── pyproject.toml          # Python dependencies
├── .env
└── README.md

Configuration Files

iii-config.yaml

The iii-config.yaml file configures the iii engine:
iii-config.yaml
modules:
  # HTTP API module
  - class: modules::api::RestApiModule
    config:
      host: 127.0.0.1
      port: 3111
  
  # Queue module (requires Redis)
  - class: modules::queue::QueueModule
    config:
      redis_url: ${REDIS_URL:redis://localhost:6379}
  
  # Cron scheduler
  - class: modules::cron::CronModule
    config:
      redis_url: ${REDIS_URL:redis://localhost:6379}
  
  # Real-time streams (requires Redis)
  - class: modules::stream::StreamModule
    config:
      redis_url: ${REDIS_URL:redis://localhost:6379}
      port: 3112
  
  # Observability (logging, traces, metrics)
  - class: modules::observability::OtelModule
    config:
      enabled: true
      level: info
      format: default
Environment variables use the syntax ${VAR_NAME:default_value}. Set REDIS_URL in your .env file to override defaults.

Environment Variables

Create a .env file for local development:
.env
# Redis connection
REDIS_URL=redis://localhost:6379

# Application settings
NODE_ENV=development
LOG_LEVEL=info

# Custom environment variables
GREETING_PREFIX=Hello

Running Your Project

1

Navigate to project directory

cd my-first-app
2

Start the iii engine

iii -c iii-config.yaml

Docker Installation (Production)

For production deployments, use Docker:

docker-compose.yml

docker-compose.yml
version: '3.8'

services:
  iii:
    image: iiidev/iii:latest
    ports:
      - '3111:3111'  # HTTP API
      - '49134:49134'  # WebSocket
      - '3112:3112'  # Stream API
      - '9464:9464'  # Metrics
    volumes:
      - ./iii-config.yaml:/app/config.yaml:ro
    environment:
      - REDIS_URL=redis://redis:6379
    depends_on:
      - redis
  
  redis:
    image: redis:7-alpine
    ports:
      - '6379:6379'
    volumes:
      - redis-data:/data

volumes:
  redis-data:
Start the stack:
docker compose up -d

Updating Motia

Homebrew

brew upgrade motia-cli

Shell Script

curl -fsSL https://raw.githubusercontent.com/MotiaDev/motia-cli/main/install.sh | sh

Troubleshooting

Ensure /usr/local/bin is in your PATH:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Or for zsh:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
You may need sudo permissions:
curl -fsSL https://raw.githubusercontent.com/MotiaDev/motia-cli/main/install.sh | sudo sh
Check if ports are available:
lsof -i :3111  # HTTP port
lsof -i :49134  # WebSocket port
Kill conflicting processes or change ports in iii-config.yaml.
Verify Redis is running:
redis-cli ping
If not using Redis, disable queue/stream modules in iii-config.yaml.
Ensure you’re using Python 3.10+:
python --version
Reinstall Motia in a virtual environment:
python -m venv venv
source venv/bin/activate
pip install motia

Next Steps

Quickstart

Build your first Motia app in 5 minutes

Your First Step

Learn how to create Steps

Configuration

Configure iii engine and modules

Examples

View 20+ production examples

Uninstalling

brew uninstall motia-cli
brew untap MotiaDev/tap

Build docs developers (and LLMs) love