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

# Getting Started

> Getting Started with FalkorDB Graph Database.

This guide will walk you through setting up FalkorDB, modeling a social network as a graph, and accessing it using one of the [FalkorDB client libraries](/getting-started/clients) with the [Cypher](/cypher) query language.

***

## Prerequisites

> **Minimum Redis version:** FalkorDB requires **Redis 8.0.0 or later**. Earlier versions (including the Redis 7.x series) are not supported. If you are self-hosting, make sure to upgrade Redis before installing or upgrading FalkorDB.

1. **FalkorDB Instance**: Set up FalkorDB (on-prem or cloud).

   **Option A — Docker (quickest)**

   ```bash theme={null}
   docker run -p 6379:6379 -p 3000:3000 --rm falkordb/falkordb:latest
   ```

   This starts FalkorDB with no authentication. Open the built-in browser at
   [http://localhost:3000](http://localhost:3000) to explore your graphs visually.
   See [Docker & Docker Compose](/operations/docker) for additional options (persistence, auth, production images).

   **Option B — FalkorDB Cloud**

   [Create a free FalkorDB Cloud Instance](https://app.falkordb.cloud/signup) and skip local setup entirely.

2. **Install FalkorDB Client**:

<CodeGroup>
  ```python Python theme={null}
  pip install falkordb
  ```

  ```javascript JavaScript theme={null}
  npm install falkordb
  ```

  ```java Java theme={null}
    <dependencies>
      <dependency>
        <groupId>com.falkordb</groupId>
        <artifactId>jfalkordb</artifactId>
        <version>0.8.0</version>
      </dependency>
    </dependencies>
  ```

  ```rust Rust theme={null}
  cargo add falkordb
  ```
</CodeGroup>

***

## Step 1: Model a Social Network as a Graph

Let's create a simple graph for a social network where:

* **Nodes** represent `User` and `Post`.
* **Relationships** connect `User`s with a `FRIENDS_WITH` relationship, and `User`s are connected via a `CREATED` relationship to `Post`s

### Graph Schema

**Node Types:**

| Node Type | Properties              | Description                             |
| --------- | ----------------------- | --------------------------------------- |
| User      | `id`, `name`, `email`   | Represents a user in the social network |
| Post      | `id`, `content`, `date` | Represents a post created by a user     |

**Relationship Types:**

| Relationship Type | Start Node | End Node | Properties | Description                            |
| ----------------- | ---------- | -------- | ---------- | -------------------------------------- |
| FRIENDS\_WITH     | User       | User     | `since`    | Indicates friendship between two users |
| CREATED           | User       | Post     | `time`     | Connects a user to their created posts |

![FalkorDB-Model a Social Network as a Graph](https://github.com/user-attachments/assets/57d9b837-661e-4500-a9f2-88e754382d29)

***

## Step 2: Load Data into FalkorDB

Here's how you can model and load the data.

### Cypher Query to Create the Data

```cypher theme={null}
CREATE (alice:User {id: 1, name: "Alice", email: "alice@example.com"})
CREATE (bob:User {id: 2, name: "Bob", email: "bob@example.com"})
CREATE (charlie:User {id: 3, name: "Charlie", email: "charlie@example.com"})

CREATE (post1:Post {id: 101, content: "Hello World!", date: 1701388800})
CREATE (post2:Post {id: 102, content: "Graph Databases are awesome!", date: 1701475200})

CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob)
CREATE (bob)-[:FRIENDS_WITH {since: 1684108800}]->(charlie)
CREATE (alice)-[:CREATED {time: 1701388800}]->(post1)
CREATE (bob)-[:CREATED {time: 1701475200}]->(post2)
```

You can execute these commands using the FalkorDB Python client or any supported client.

***

## Step 3: Access Your Data

### Connect to FalkorDB

The examples below connect to a local FalkorDB instance started with the
`docker run` command above, which requires no password.

<CodeGroup>
  ```python Python theme={null}
  from falkordb import FalkorDB

  # Connect to FalkorDB (no authentication — default Docker setup)
  client = FalkorDB(host="localhost", port=6379)
  graph = client.select_graph('social')
  ```

  ```javascript JavaScript theme={null}
  import { FalkorDB } from 'falkordb';

  // Connect to FalkorDB (no authentication — default Docker setup)
  const client = await FalkorDB.connect({
    host: "localhost",
    port: 6379
  });
  const graph = client.selectGraph('social');
  ```

  ```java Java theme={null}
  package com.myproject;

  import com.falkordb.*;

  // Connect to FalkorDB (no authentication — default Docker setup)
  Driver driver = FalkorDB.driver("localhost", 6379);
  Graph graph = driver.graph("social");
  ```

  ```rust Rust theme={null}
  use falkordb::{FalkorClientBuilder, FalkorConnectionInfo};

  // Connect to FalkorDB (no authentication — default Docker setup)
  let connection_info: FalkorConnectionInfo = "falkor://127.0.0.1:6379".try_into()
              .expect("Invalid connection info");

  let client = FalkorClientBuilder::new()
             .with_connection_info(connection_info)
             .build()
             .expect("Failed to build client");

  // Select the social graph
  let mut graph = client.select_graph("social");
  ```
</CodeGroup>

> **Using authentication?** Start FalkorDB with a password:
>
> ```bash theme={null}
> docker run -p 6379:6379 -p 3000:3000 --rm \
>   -e REDIS_ARGS="--requirepass yourpassword" \
>   falkordb/falkordb:latest
> ```
>
> Then pass your password in the client configuration, for example
> `password="yourpassword"` in Python or `password: 'yourpassword'` in JavaScript,
> or use the equivalent credential option in your client library. See
> [Docker & Docker Compose](/operations/docker) for details.

### Execute Cypher Queries

#### Create the Graph

<CodeGroup>
  ```python Python theme={null}
  create_query = """
  CREATE (alice:User {id: 1, name: "Alice", email: "alice@example.com"})
  CREATE (bob:User {id: 2, name: "Bob", email: "bob@example.com"})
  CREATE (charlie:User {id: 3, name: "Charlie", email: "charlie@example.com"})

  CREATE (post1:Post {id: 101, content: "Hello World!", date: 1701388800})
  CREATE (post2:Post {id: 102, content: "Graph Databases are awesome!", date: 1701475200})

  CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob)
  CREATE (bob)-[:FRIENDS_WITH {since: 1684108800}]->(charlie)
  CREATE (alice)-[:CREATED {time: 1701388800}]->(post1)
  CREATE (bob)-[:CREATED {time: 1701475200}]->(post2)
  """

  graph.query(create_query)
  print("Graph created successfully!")
  ```

  ```javascript JavaScript theme={null}
  const createQuery = `
  CREATE (alice:User {id: 1, name: "Alice", email: "alice@example.com"})
  CREATE (bob:User {id: 2, name: "Bob", email: "bob@example.com"})
  CREATE (charlie:User {id: 3, name: "Charlie", email: "charlie@example.com"})

  CREATE (post1:Post {id: 101, content: "Hello World!", date: 1701388800})
  CREATE (post2:Post {id: 102, content: "Graph Databases are awesome!", date: 1701475200})

  CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob)
  CREATE (bob)-[:FRIENDS_WITH {since: 1684108800}]->(charlie)
  CREATE (alice)-[:CREATED {time: 1701388800}]->(post1)
  CREATE (bob)-[:CREATED {time: 1701475200}]->(post2)
  `;

  let result = await graph.query(createQuery);
  console.log("Graph created successfully!");
  ```

  ```java Java theme={null}
  String createQuery = 
  "CREATE (alice:User {id: 1, name: \"Alice\", email: \"alice@example.com\"}) " +
  "CREATE (bob:User {id: 2, name: \"Bob\", email: \"bob@example.com\"}) " +
  "CREATE (charlie:User {id: 3, name: \"Charlie\", email: \"charlie@example.com\"}) " +

  "CREATE (post1:Post {id: 101, content: \"Hello World!\", date: 1701388800}) " +
  "CREATE (post2:Post {id: 102, content: \"Graph Databases are awesome!\", date: 1701475200}) " +

  "CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob) " +
  "CREATE (bob)-[:FRIENDS_WITH {since: 1684108800}]->(charlie) " +
  "CREATE (alice)-[:CREATED {time: 1701388800}]->(post1) " +
  "CREATE (bob)-[:CREATED {time: 1701475200}]->(post2)";

  ResultSet resultSet = graph.query(createQuery);
  System.out.println("Graph created successfully!");
  ```

  ```rust Rust theme={null}
  let create_query = r#"
  CREATE (alice:User {id: 1, name: \"Alice\", email: \"alice@example.com\"})
  CREATE (bob:User {id: 2, name: \"Bob\", email: \"bob@example.com\"})
  CREATE (charlie:User {id: 3, name: \"Charlie\", email: \"charlie@example.com\"})

  CREATE (post1:Post {id: 101, content: \"Hello World!\", date: 1701388800})
  CREATE (post2:Post {id: 102, content: \"Graph Databases are awesome!\", date: 1701475200})

  CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob)
  CREATE (bob)-[:FRIENDS_WITH {since: 1684108800}]->(charlie)
  CREATE (alice)-[:CREATED {time: 1701388800}]->(post1)
  CREATE (bob)-[:CREATED {time: 1701475200}]->(post2)
  "#;

  graph.query(create_query).execute().await?;
  println!("Graph created successfully!");
  ```
</CodeGroup>

![image](https://github.com/user-attachments/assets/f67c9a1d-4b80-435d-9038-b7e1f931da74)

#### Query the Graph

<CodeGroup>
  ```python Python theme={null}
  # Find all friends of Alice
  query = """
  MATCH (alice:User {name: 'Alice'})-[:FRIENDS_WITH]->(friend)
  RETURN friend.name AS Friend
  """

  result = graph.ro_query(query).result_set

  print("Alice's friends:")
  for record in result:
      print(record[0])
  ```

  ```javascript JavaScript theme={null}
  const query = `
  MATCH (alice:User {name: "Alice"})-[:FRIENDS_WITH]->(friend)
  RETURN friend.name AS Friend
  `;
  const result = await graph.roQuery(query);
  console.log("Alice's friends:");
  for (const record of result) {
    console.log(record["Friend"]);
  }
  ```

  ```java Java theme={null}
  String query = """
  MATCH (alice:User {name: \"Alice\"})-[:FRIENDS_WITH]->(friend)
  RETURN friend.name AS Friend
  """;
  ResultSet result = graph.readOnlyQuery(query);
  System.out.println("Alice's friends:");
  for (Record record : result) {
      System.out.println(record.get("Friend"));
  }
  ```

  ```rust Rust theme={null}
  let query = r#"
  MATCH (alice:User {name: \"Alice\"})-[:FRIENDS_WITH]->(friend)
  RETURN friend.name AS Friend
  "#;
  let result = graph.ro_query(query).execute().await?;

  println!("Alice's friends:");
  for record in result.data.by_ref() {
      println!("{}", record["Friend"]);
  }
  ```
</CodeGroup>

#### Query Relationships

<CodeGroup>
  ```python Python theme={null}
  # Find posts created by Bob
  query = """
  MATCH (bob:User {name: 'Bob'})-[:CREATED]->(post:Post)
  RETURN post.content AS PostContent
  """

  result = graph.ro_query(query).result_set

  print("Posts created by Bob:")
  for record in result:
      print(record[0])
  ```

  ```javascript JavaScript theme={null}
  const query = `
  MATCH (bob:User {name: "Bob"})-[:CREATED]->(post:Post)
  RETURN post.content AS PostContent
  `;
  const result = await graph.roQuery(query);
  console.log("Posts created by Bob:");
  for (const record of result) {
    console.log(record["PostContent"]);
  }
  ```

  ```java Java theme={null}
  String query = """
  MATCH (bob:User {name: \"Bob\"})-[:CREATED]->(post:Post)
  RETURN post.content AS PostContent
  """;
  ResultSet result = graph.readOnlyQuery(query);
  System.out.println("Posts created by Bob:");
  for (Record record : result) {
      System.out.println(record.get("PostContent"));
  }
  ```

  ```rust Rust theme={null}
  let query = r#"
  MATCH (bob:User {name: \"Bob\"})-[:CREATED]->(post:Post)
  RETURN post.content AS PostContent
  "#;
  let result = graph.ro_query(query).execute().await?;
  println!("Posts created by Bob:");
  for record in result.data.by_ref() {
      println!("{}", record["PostContent"]);
  }
  ```
</CodeGroup>

***

## Step 4: Explore Further

Congratulations! 🎉 You have successfully modeled, loaded, and queried a social network graph with FalkorDB.

Next, dive deeper into FalkorDB's powerful features:

* [FalkorDB Browser](/browser) — Explore your graph visually
* [Advanced Cypher](/cypher)
* [Data Types](/datatypes) — Nodes, relationships, scalars, temporal types, and collections
* [Database Operations](/operations)
* [GenAI Tools](/genai-tools)
* [Agentic Memory](/agentic-memory)

For questions or support, visit our [community forums](https://www.falkordb.com/contact-us/)

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What are the minimum requirements to run FalkorDB?">
    FalkorDB requires **Redis 8.0.0 or later**. The quickest setup is via Docker: `docker run -p 6379:6379 -p 3000:3000 --rm falkordb/falkordb:latest`. Alternatively, use [FalkorDB Cloud](https://app.falkordb.cloud) to skip local setup entirely.
  </Accordion>

  <Accordion title="Do I need to install Redis separately?">
    No. The official FalkorDB Docker images include everything needed. If you are self-hosting without Docker, you must install Redis 8.0.0+ separately and load the FalkorDB module. Earlier Redis versions (including 7.x) are **not supported**.
  </Accordion>

  <Accordion title="Which client libraries can I use with FalkorDB?">
    FalkorDB has official clients for **Python**, **Node.js**, **Java**, **Rust**, **Go**, **PHP**, and **C#**. Install them via pip, npm, Maven, Cargo, or the respective package managers. See the [Client Libraries](/getting-started/clients) page for full details.
  </Accordion>

  <Accordion title="What is the FalkorDB Browser at port 3000?">
    The FalkorDB Browser is a built-in web UI for visually exploring your graphs. When running the `falkordb/falkordb:latest` Docker image, open [http://localhost:3000](http://localhost:3000) to create, visualize, and query graphs interactively. For production, use `falkordb/falkordb-server` which excludes the browser.
  </Accordion>

  <Accordion title="How do I model data in FalkorDB?">
    FalkorDB uses the **Property Graph Model**. Data is modeled as **nodes** (entities with labels and properties) connected by **relationships** (directed edges with a type and properties). Use the Cypher query language to create and query your graph structure.
  </Accordion>
</AccordionGroup>
