# Installation

## 1. Add Database, Social & Mailgun Settings

Navigate to the folder where you downloaded Gravity and open the **.env** & **/config/default.json** files located in the **/server** folder and then populate your database and Mailgun credentials.&#x20;

{% hint style="info" %}
If you're on the Power plan, you can use the setup wizard included with the React web client.
{% endhint %}

To use social sign-ons you must add your Facebook and Twitter API keys to the **.env** file and also the callback URLs to **/config.** [See the section on Social Sign-Ons for more information](/gravity-server/authentication/social-sign-on.md).

You must complete this step before proceeding.

## 2. Install Expo

The Expo CLI will enable you to perform various Expo tasks, like running and building your app.

```javascript
npm install expo
```

## 3. Download the Expo Mobile Client

On your iOS or Android mobile device, visit the respective app store, download the Expo mobile client then [register a free account](https://expo.io/signup).

## 4. Install Gravity Native

The installation process is the same as described in the [server installation instructions](/gravity-server/installation/install-gravity.md), except you must specify your desired database driver if not using MySQL.

```javascript
// standard (mysql2)
npm run setup

// mongo
npm run setup db:mongo

// postgres
npm run setup db:pg
```

This will install all of the dependencies required. Once the installation process has finished, you can start your app:

```javascript
cd app
npx expo start
```

If you open the Expo mobile app or iOS or Android simulator, you can see your app.

{% hint style="warning" %}
Inside **/app/config.json** is a baseURL setting that points to the Gravity server for making API calls. During setup, this will be automatically set to your local network address, but you should update this to point to your development server.
{% endhint %}

## 5. Install ngrok (optional)

If you want to use social sign-ons in your application, you must [install ngrok](https://ngrok.com/docs/getting-started/) to handle the redirects.

Once installed, please update the **callback\_url** inside the **/config** folder files and also the **baseURL** value inside **app/config.json**

### 6. Add Expo Project ID

Create a new Project in your Expo account and copy and paste the Project UUID to `app.json` → `expo.extra.eas.projectId` for notifications to work.

## Running Your App

Finally, to run your app any time, enter the following command.

```javascript
npx expo start
```

This will start both Gravity Server and the Expo client.

### Running in a Simulator

Once your Expo server is running, you can open your app in the Android simulator by pressing **a** or **i** to open the iOS simulator.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-native/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
