> ## Documentation Index
> Fetch the complete documentation index at: https://dylankenneally-react-native-ssh-sftp-96.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and configure React Native SSH SFTP.

export const EditThisPage = ({filePath}) => {
  const REPO_EDIT_BASE_URL = 'https://github.com/dylankenneally/react-native-ssh-sftp/edit/master';
  return <div className="mt-10 rounded-2xl border border-zinc-950/10 bg-zinc-50 px-4 py-3 dark:border-white/10 dark:bg-white/5">
      <p className="m-0 text-sm text-zinc-600 dark:text-zinc-300">
        See something to improve?{' '}
        <a href={`${REPO_EDIT_BASE_URL}/${filePath}`}>Edit this page on GitHub</a>{' '}
        to suggest a change.
      </p>
    </div>;
};

This guide will walk you through installing the React Native SSH SFTP library and configuring it for both iOS and Android platforms.

## Install the Package

Install the library using your preferred package manager:

<CodeGroup>
  ```bash npm theme={null}
  npm install @dylankenneally/react-native-ssh-sftp
  ```

  ```bash yarn theme={null}
  yarn add @dylankenneally/react-native-ssh-sftp
  ```

  ```bash pnpm theme={null}
  pnpm add @dylankenneally/react-native-ssh-sftp
  ```
</CodeGroup>

## iOS Setup

<Steps>
  <Step title="Update your Podfile">
    The library requires a specific fork of NMSSH that includes an updated version of libssh. Add the following line to your `Podfile` located at `./ios/Podfile`:

    ```ruby ios/Podfile theme={null}
    target 'YourProjectName' do
      pod 'NMSSH', :git => 'https://github.com/aanah0/NMSSH.git'
      # ... rest of your target details ...
    end
    ```

    <Info>
      We use [aanah0's fork](https://github.com/aanah0/NMSSH) of NMSSH to get a required later version of libssh.
    </Info>
  </Step>

  <Step title="Install pods">
    Run pod install in your iOS directory:

    ```bash theme={null}
    cd ios
    pod install
    cd ..
    ```
  </Step>

  <Step title="Optional: Automate pod installation">
    Add a `postinstall` script to your `package.json` to automatically run `pod install` after `npm install`:

    ```json package.json theme={null}
    {
      "scripts": {
        "postinstall": "npx pod-install"
      }
    }
    ```

    <Tip>
      The [`pod-install`](https://www.npmjs.com/package/pod-install) package is a cross-platform way to handle iOS pod installation.
    </Tip>
  </Step>
</Steps>

### Troubleshooting iOS

<Warning>
  **Having OpenSSL issues on iOS?**

  If you are using [Flipper](https://fbflipper.com/) to debug your app, it already includes a copy of OpenSSL which can conflict with the version used by NMSSH.

  To resolve this, disable Flipper by removing or commenting out the following line in your `Podfile`:

  ```ruby theme={null}
  # flipper_configuration => flipper_config,
  ```
</Warning>

<Note>
  **iOS Simulator Not Supported**

  This package currently doesn't support the iOS simulator. You will need to test on a physical iOS device. See [this issue](https://github.com/dylankenneally/react-native-ssh-sftp/issues/20) for more information.
</Note>

## Android Setup

No additional configuration is required for Android. The library works out of the box after installation.

## Linking

This library uses React Native autolinking (introduced in React Native 0.60+). Manual linking is **not required**.

<Info>
  If you're using React Native 0.60 or later, the library will be automatically linked. Simply rebuild your app after installation.
</Info>

## Next Steps

Now that you have the library installed, check out the [Quick Start](/quickstart) guide to learn how to connect to an SSH server and execute your first command.

<EditThisPage filePath="docs/installation.mdx" />
