> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-file-handling/apache-camel-tbu/local-docker-setup-for-sftp-server.md).

# Local Docker Setup for SFTP Server

## Prerequisites

Docker installation is completed in the system. In the below example, [colima](https://github.com/abiosoft/colima) is used on Mac System.

## Step 1: Start the colima with `colima start`

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-4ea8209bdeaa8f9248a6d2e5d137bce4a1b4fc9f%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Step 2: Configure docker in Intellij

Install the Docker plugin in Intellij - <https://plugins.jetbrains.com/plugin/7724-docker>

Configure the Docker plugin

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-27cfe879a1f14fe051a216ec654b1dd2108d3517%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

To find the TCP socket - Engine API URL for colima, run `docker context ls` command. Sample value is given below.

```
unix:///Users/pranayp/.colima/aarch64/docker.sock
```

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-7856700e9ca644b6776efd4e4914c6204b1c1b13%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Configure the Docker executable and Compose executable

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-5916a35465bfd726ca438774e9de148427f485ce%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

To find Docker executable and Docker Compose executable, run the below command

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-71c0de1acab691346695b027c0dacefba9706e88%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Step 3: Prepare the docker-compose file

Save the below content in docker-compose file

*docker-compose.yml*

```yaml
version: "3.9"
# https://docs.docker.com/compose/compose-file/

services:
  sftp-server:
    container_name: sftp-server
    image: antrea/sftp #https://hub.docker.com/r/antrea/sftp
    platform: linux/amd64 #Change the platform as needed
    ports:
      - "9922:22"
    volumes:
      - ./sftp_test_data:/home/sftpuser/upload/sftp_test_data  # Mount a local directory to the container
    environment:
      SFTP_USERS: "sftpuser:pass:1001:100"  # Set the username, password, UID (user id), and GID (group user id)
      SFTP_CHROOT: "/home/sftpuser"  # Restrict user to the home directory

networks:
  default:
    name: default_network
```

Since, we are attaching a volume of local `sftp_test_data` folder, create a folder and add some test files there.

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-5b7f1704fac93cf06fd1442dd99c3ea19c80732d%2Fimage.png?alt=media" alt="" width="537"><figcaption></figcaption></figure>

## Step 4: Run the docker-compose file

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-82a58916bec561379e4f970556e8e69bbc62dd86%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Step 5: Connect the sftp server via any tools

Here, we will use FileZilla Client. Download and Install the FileZilla client from below url

<https://filezilla-project.org/download.php?type=client#close>

Open the FileZilla Client

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-848689f968153557412f44cc4b833e89f1b49e85%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Add below details as we configure in docker-compose file

```
Host: sftp://127.0.0.1
Username: sftpuser
Password: pass
Port: 9922
```

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-4716a40dc5bf8b3693b03084424f7f5def9175c6%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Click on Quickconnect and click on OK

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-4c78237142e149d5aabcbacccc86f74ea17d465a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Remote site details should be visible now

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-ac04e0b305b4658b9f0c6de7ae3a8816dd3ea054%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-file-handling/apache-camel-tbu/local-docker-setup-for-sftp-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
