---
title: "Connect SFTP / FTPS to Rig — Rig guide"
description: "Connect an SFTP or FTPS server to Rig and load CSV, Excel, Parquet, JSONL or fixed-width files into one warehouse table."
canonical: "https://rig.so/guides/connect-sftp"
format: markdown
---

Search guides, references, playbooks…⌘K

Browse guides

# Connect SFTP / FTPS to Rig

Rig connects to your SFTP or FTPS server, finds the files that match a pattern and loads their rows into one table. It reads only new or changed files, and it can move loaded files into an archive folder for you.

## Before you start

- You need the server address, a username, and either a password or a private key.
- If the server only accepts connections from approved addresses, ask the server's owner to allow Rig's sync address. [Contact us](https://rig.so/contact) for the address that applies to your region.
- One connection loads one feed. A folder that holds several unrelated feeds needs a connection per feed, each with its own file pattern.

## Step 1: Prepare the server

1. Create or choose a login with read access to the folder that holds the files. Add write access only if you want Rig to archive loaded files.
2. For SFTP with a key, have the private key ready in OpenSSH or PEM form (Ed25519, ECDSA or RSA).
3. Optionally, get the server's host key from its owner. For SFTP, `ssh-keyscan -p <port> <host>` prints it, and its output should be checked with the owner.

## Step 2: Connect it in Rig

New to Rig? Watch how to find Connections

Adding a source needs a workspace owner, or a role with the Manage connections permission, on a workspace where you manage your own connections. If the Connectors tab says “Data ingestion for this workspace is managed by Rig”, ask an owner or Rig support to add the source.

1. In Rig, open `Connections`, choose the `Connectors` tab and go to `Sources & actions`.
2. Search for **SFTP / FTPS**, open the card and click `Connect`.
3. **Protocol**: choose SFTP for SSH file transfer, with a password or a private key, or FTPS for FTP over explicit TLS, with a password. It defaults to SFTP.
4. **Host**: the server address, such as `sftp.partner.com`.
5. **Port**: leave blank for the defaults, 22 for SFTP and 21 for FTPS.
6. **Username**: the login name.
7. **Password**: the password. Leave it blank when you use a private key.
8. **Private key (SFTP)**: the whole private key, pasted in. SFTP only.
9. **Key passphrase**: only if the private key has one.
10. **Host key**: leave blank and Rig pins the server's key when you connect. If the server only allows Rig's sync address, paste the key instead: for SFTP the output of `ssh-keyscan`, for FTPS the certificate's SHA-256 as `sha256:<hex>`.
11. **Folder**: the folder to read. It defaults to `/`.
12. **File name pattern**: a case-insensitive glob, with alternatives separated by `;`, such as `GL_*.csv;GL_*.xlsx`. Blank picks up every extension the chosen file format reads.
13. **Include subfolders**: choose Yes to read subfolders. It defaults to No.
14. **Destination table name**: the table the files load into.
15. **File format**: leave on Detect from extension for CSV, TSV, Excel, Parquet and JSONL, or choose Delimited text, Excel or Fixed-width text.
16. **Fixed-width columns**: for fixed-width files only, `name:width` in order, such as `account:10,period:7,amount:15`.
17. **Text encoding**: leave as `utf-8`, or set something like `cp1252` for older finance-system exports.
18. **Archive folder**: optional. Loaded files move here on the following sync. Leave blank to keep Rig read-only.
19. Click `Continue`. Rig checks the credentials and lists the streams it can reach, so choose the ones you want and click `Connect`.
20. The source then syncs on its schedule, which is nightly unless you change it. To load data straight away, click `Sync` on its row; `Test` pulls a small sample first if you want to check the connection.

## What Rig pulls in

SFTP / FTPS lands in its own `sftp` schema in your warehouse:

- **One table**: the rows of every matching file, in the table you named. Excel files add a `sheet` column, one value per tab.

## Good to know

- Rig tracks each file by its modified time, size and parse settings. A corrected file re-dropped under the same name replaces its earlier rows. Changing the format, encoding or fixed-width layout re-reads every file.
- A re-drop that has a header and no data rows leaves the earlier rows in place.
- With an archive folder set, a file that reappears under an archived name is loaded as a new drop beside the earlier rows, which suits a nightly file with a fixed name. Archived copies are never overwritten.
- Files Rig cannot read are skipped and left where they are, so someone can look at them.
- Rig connects from a fixed address in each region, so a firewall rule on the server can be specific.
- To disconnect SFTP / FTPS, click the bin icon on the source's row under `Sources & actions`. Only whoever connected the source or a workspace owner can do this, and data already synced stays in the warehouse.

## What people use this for

- Land a partner's nightly export
- Read exports from older finance systems
- Replace a row when a file is corrected

[More ideas for using SFTP / FTPS](https://rig.so/integrations/sftp)

## SFTP / FTPS documentation

- [ssh-keyscan manual page](http://man.openbsd.org/ssh-keyscan.1)

Was this guide helpful?

Yes No

---

- [This page as HTML](https://rig.so/guides/connect-sftp)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
