Run This Ai
EN DE

Getting Started with Mage AI: Docker Installation and Your First Pipeline

Mage AI

Introduction

Mage AI is one of the fastest ways to get started with data pipeline orchestration for AI and ML workloads. In this tutorial, you will deploy Mage AI using Docker, create your first data pipeline, and connect it to a data source — all within minutes.

Prerequisites

  • Docker and Docker Compose installed on your server or local machine
  • At least 2 GB of RAM allocated to Docker
  • Basic familiarity with Python or SQL

Step 1: Deploy Mage AI with Docker

The fastest way to run Mage AI is with Docker. Create a new directory and a docker-compose.yml file:

services:
  mage-ai:
    image: mageai/mageai:latest
    restart: unless-stopped
    ports:
      - 8080:8080
    volumes:
      - ./data/mage-ai:/data

Then start the service:

docker compose up -d

Wait a moment for the first-time setup, then open http://localhost:8080 in your browser.

Mage AI interface

Step 2: Create Your First Pipeline

Once Mage is running, click "New Pipeline" to start. You will be prompted to choose a pipeline type:

  • Standard (Batch) — For scheduled, batch-oriented data processing
  • Streaming — For real-time data ingestion
  • Integration — For syncing data between sources and destinations

For this tutorial, choose Standard (Batch) and give your pipeline a name like hello_mage.

Step 3: Add Pipeline Blocks

Mage pipelines are built from blocks — modular units of code. Each block can be Python, SQL, or R. Add a Python data loader block:

import pandas as pd
import io

# Create sample data
data = """name,age,city
Alice,30,New York
Bob,25,San Francisco
Charlie,35,London
"""
df = pd.read_csv(io.StringIO(data))
return df

Then add a transformer block to process the data:

@transformer
def transform(df, *args, **kwargs):
    df['age_group'] = df['age'].apply(
        lambda x: 'Young' if x < 30 else 'Adult'
    )
    return df

Step 4: Run and Monitor

Click "Run" on each block to execute it. Mage automatically visualizes the pipeline DAG and shows runtime metrics for each block. You can inspect logs, view output data, and debug interactively — all from the browser.

Conclusion

You now have Mage AI running with Docker and a working data pipeline. From here you can connect real data sources (PostgreSQL, BigQuery, S3, etc.), schedule pipelines to run automatically, and integrate with ML training workflows. Mage's intuitive interface and multi-language support make it an ideal choice for AI teams looking to streamline their data infrastructure.