> ## Documentation Index
> Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick start

> Get started with RisingWave in under 5 minutes. Install via Docker, Homebrew, or script, connect with psql, and create your first materialized view.

Need help generating SQL? Use [Claude Code](https://claude.ai/claude-code) or [Cursor](https://cursor.com) with the [RisingWave MCP server](https://github.com/risingwavelabs/risingwave-mcp) to generate and run SQL interactively.

## Step 1: Start RisingWave

For convenience, this quick start guide uses the standalone deployment mode.

<Tip>
  **Not sure which installation method to use?** See [Deployment modes overview](/deploy/deployment-modes-overview) for a comparison of all options.
</Tip>

### Script installation

Open a terminal and run the following `curl` command.

```bash theme={null}
curl -L https://risingwave.com/sh | sh
```

To start a RisingWave instance, run the following command.

```bash theme={null}
risingwave
```

### Docker

Ensure [Docker Desktop](https://docs.docker.com/get-docker/) is installed and running in your environment.

```bash theme={null}
docker run -it --pull=always -p 4566:4566 -p 5691:5691 risingwavelabs/risingwave:latest single_node
```

### Homebrew

Ensure [Homebrew](https://brew.sh/) is installed, and run the following commands:

```bash theme={null}
brew tap risingwavelabs/risingwave
brew install risingwave
risingwave
```

## Step 2: Connect to RisingWave

Ensure you have `psql` installed in your environment. To learn about how to install it, see [Install psql without PostgreSQL](/deploy/install-psql-without-postgresql).

Open a new terminal window and run:

```bash theme={null}
psql -h localhost -p 4566 -d dev -U root
```

Instead of using the command line, you can also use the [RisingWave Console](/web-ui/introduction), a web-based interface for managing and querying your RisingWave cluster. The console provides a visual way to run SQL queries, monitor cluster health, explore database schemas, and execute operational commands through an intuitive web interface.

## Step 3: Insert some data

RisingWave supports both direct data insertion and streaming data ingestion from sources like message queues and database change streams.

To keep things simple, we'll demonstrate the approach of direct data insertion. Let's create a table and insert some data.

For instance, we can create a table named `credit_card_transactions` to store information about credit card usage.

```sql Create the table theme={null}
CREATE TABLE credit_card_transactions (
  card_id VARCHAR,
  amount DECIMAL,
  ts TIMESTAMP
);
```

```sql Insert five rows of data theme={null}
INSERT INTO credit_card_transactions (card_id, amount, ts)
VALUES
  ('card_123', 1200.00, '2022-01-01 10:00:00'),
  ('card_123', 1800.00, '2022-01-01 10:00:20'),
  ('card_123', 1900.00, '2022-01-01 10:00:40'),
  ('card_456', 4000.00, '2022-01-01 10:01:00'),
  ('card_456', 950.00,  '2022-01-01 10:01:30');
```

## Step 4: Analyze and query data

Next, we will detect potentially fraudulent behavior by identifying any card that spends more than \$5000 within a one-minute window.

To do this, we'll use a **materialized view**. A materialized view in RisingWave is not a static snapshot or a one-time query. Instead, it's a continuously maintained result that automatically stays up to date as new data arrives. You can think of it as a live dashboard behind a SQL query.

```sql Create a materialized view that detects high-spending cards in 1-minute windows theme={null}
CREATE MATERIALIZED VIEW fraud_alerts AS
SELECT
  card_id,
  window_start,
  window_end,
  SUM(amount) AS total_amount
FROM
  TUMBLE(
    credit_card_transactions,  -- the source table
    ts,                        -- the event timestamp column
    INTERVAL '1 minute'        -- window size
  )
GROUP BY
  card_id, window_start, window_end
HAVING
  SUM(amount) > 5000;          -- only alert if total spend exceeds $5000
```

When this materialized view (MV) is created, RisingWave starts tracking it **immediately**. You don't need to refresh or re-run the query manually. Any future insertion into `credit_card_transactions` will automatically update `fraud_alerts`.

```sql Query the current result theme={null}
SELECT * FROM fraud_alerts;
------
 card_id  |     window_start     |     window_end       | total_amount
----------+----------------------+----------------------+--------------
(0 rows)
```

At this point, no fraud alert is triggered yet. Let's insert one more transaction to push `card_123` over the \$5000 threshold.

```sql Insert additional data to trigger fraud alert theme={null}
INSERT INTO credit_card_transactions (card_id, amount, ts)
VALUES ('card_123', 600.00, '2022-01-01 10:00:50');
```

```sql Query the updated result theme={null}
SELECT * FROM fraud_alerts;
------
 card_id  |     window_start     |     window_end       | total_amount
----------+----------------------+----------------------+--------------
 card_123 | 2022-01-01 10:00:00  | 2022-01-01 10:01:00  | 5500.00
(1 row)
```

As you can see, the MV is automatically updated when new data is inserted. You don't need to manage any refresh logic or manual updates. RisingWave handles the incremental computation for you in the background.

## What's next?

Congratulations! You've successfully started RisingWave and conducted some initial data analysis. To explore further, you can:

* **Follow another tutorial**:
  * [Iceberg in 10 minutes (AWS)](/iceberg/quick-start)
  * [Ingest data from Kafka](https://github.com/risingwavelabs/awesome-stream-processing/blob/main/00-get-started/01-ingest-kafka-data.md)
  * [Ingest data from Postgres CDC](https://github.com/risingwavelabs/awesome-stream-processing/blob/main/00-get-started/02-ingest-pg-cdc.md)
* **Explore ready-to-run applications** in the [awesome stream processing GitHub repository](https://github.com/risingwavelabs/awesome-stream-processing).
* **Dive deeper into our documentation** to learn about ingesting data, performing data transformations, and delivering data to downstream systems.

<head>
  <script type="application/ld+json">
    {`
          {
            "@context": "https://schema.org",
            "@type": "HowTo",
            "name": "How to install RisingWave and run your first streaming query",
            "description": "Get started with RisingWave in under 5 minutes. Install via Docker, Homebrew, or script, connect with psql, and create your first materialized view for real-time stream processing.",
            "step": [
              {
                "@type": "HowToStep",
                "name": "Start RisingWave",
                "text": "Install and start RisingWave using one of three methods: run the install script with curl, use Docker to pull and run the latest image, or install via Homebrew on macOS."
              },
              {
                "@type": "HowToStep",
                "name": "Connect to RisingWave",
                "text": "Open a new terminal and connect to RisingWave using psql: psql -h localhost -p 4566 -d dev -U root"
              },
              {
                "@type": "HowToStep",
                "name": "Insert data",
                "text": "Create a table and insert sample data. For example, create a credit_card_transactions table and insert transaction records."
              },
              {
                "@type": "HowToStep",
                "name": "Create a materialized view and query results",
                "text": "Create a materialized view to continuously compute results (e.g., fraud detection). The view updates automatically as new data arrives. Query it with a standard SELECT statement."
              }
            ]
          }
          `}
  </script>
</head>
