---
# System prepended metadata

title: FTP Server Deployment
tags: [pure ftpd, ftp server]

---

---
title: FTP Server Deployment
tags: pure ftpd, ftp server
description: instruction of setting up pure ftpd
---

# FTP Server Deployment

## Install Pre-request packages
Install docker compose 
```
$ sudo apt-get update
$ sudo apt-get install docker-compose
```

### Deploy pure ftpd with docker compose
Run `docker-compose -f pureftpd-dockercompose.yml up -d`

#### pureftpd-dockercompose.yml
```
version: '2.3'
services:
  ftpd_server:
    image: stilliard/pure-ftpd
    container_name: pure-ftpd
    ports:
      - "21:21"
      - "5000:5000"
      - "30000-30009:30000-30009"
    volumes: 
      - "/data/ftp/data:/home/qct/"
      - "/data/ftp/passwd:/etc/pure-ftpd/passwd"
    environment:
      PUBLICHOST: "localhost"
      FTP_USER_NAME: qct
      FTP_USER_PASS: password
      FTP_USER_HOME: /home/qct
    restart: always
```



### ftp command

#### access ftp server
`$ ftp <fpt server ip>:<port>`

#### upload file
`$ put local_file.txt remote_file.txt`


#### download file
`$ get remote_file.txt local_file.txt`

#### export http on port 5000
```
$ cd /home/qct
$ nohup python3 -m http.server 5000 > /dev/null 2>&1 &
```

## 參考

## Thank you! :dash: 

You can find me on

- GitHub: https://github.com/shaung08
- Email: a2369875@gmail.com
