Cloud FTP Storage DIY: How to setup an inexpensive FTP server in the cloud

Here we learn how to create your own cloud storage in 5 minutes at a fraction of the cost and get it connected via FTP. So you can easily map it as a drive, set it as a target for your cameras recording, etc.
- Pay-as-you-go at the lowest price on the market.
- Manage your cloud storange in the way you want it.
- Connect it to as many devices as you wish.
- Newer pay for any third party solution.
- Map it as drive, connect via FTP.
- Store your cameras recordings as long as you wish.
- Play videos directly from the cloud.
Step 1. Create an Amazon S3 Storage.
- Create a free Amazon AWS account (if you don’t have one) here https://aws.amazon.com/
- Now, log into your console https://console.aws.amazon.com/console/ and select the S3 service.

4. Choose any bucket name (cloudtest8 e.g.).
5. Select the desired region where to allocate your cloud storage (Ohio e.g.)
6. Click Create button.
Step 2. Create an Amazon EC2 Instance.
- Log into your console https://console.aws.amazon.com/console/
- Select the EC2 service.

4. Click Launch Instance.

7. Click your Review and Launch.


10. Choose a name for your key pair (storage, e.g.)
11. Click on Download Key Pair button.
12. Click on Launch Instances button.
13. Find the downloaded storage.pem file and move it to the location where you can easily find it later.
Step 3. Connect to your EC2 Instance.
- Download Bitvise SSH Tunellier Client and install it.
- Launch Bitvise.


10. Enter ubuntu as Username.
11. Select publickey as Initial method.
12. Choose previously imported Client key.
13. And click Login button.

Step 4. Install S3
Enter this commands in exact order as shown below.
TIP: You can copy (Ctrl-C) and paste them into the terminal windows with right-mouse button.
1. Type sudo apt-get install vsftpd and press Enter. When prompted type Y and press Enter.
2. Type sudo adduser s3 and press Enter. Then, type any password and press Enter. Retype the password and press Enter again. Write down the password, you will need it later. Press Enter several times when prompted for the user details. Confirm that the information is correct by typing Y and then press Enter.
3. Type sudo nano /etc/vsftpd.conf and press enter. Scroll down to the end if the file and copy-paste the following lines into it.
write_enable=YES
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER
pasv_min_port=40000
pasv_max_port=50000
listen_port=45000
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
Once done, press Ctrl-O to write out the changes, hit Enter and Ctrl-X to exit editing vsftpd.conf
4. Type echo “s3” | sudo tee -a /etc/vsftpd.userlist and press enter.
5. Next, type sudo nano /etc/ssh/sshd_config and press enter.
6. Scroll down to find PasswordAuthentication no and replace it with PasswordAuthentication yes. Press Ctrl-O to write out the changes, press Enter and Ctrl-X to exit editing sshd_config.
7. Then type sudo service sshd restart and press enter.
8. Then type sudo apt-get update and press enter. Type Y and hit Enter once prompted. Wait a minute for installation process to complete.
9. Now, type sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config type Y and hit Enter once prompted. Wait a minute for the installation process to complete.
10. Next, type sudo git clone https://github.com/s3fs-fuse/s3fs-fuse.git and press Enter. You will get message “Checking connectivity… done.”
11. Next, type the following commands pressing Enter after each one.
cd s3fs-fuse
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install
sudo su
cd /
Now you’ll need your Amazon ID and Key in order to attach your S3 cloud storage to the server.
Step 5. Attach your S3 cloud storage to the server.

Log into your Amazon IAM Management Console https://console.aws.amazon.com/iam/home?#/security_credential and click on Continue to Security Credentials button.
Once logged in, please follow the arrow tags in exact order as shown in the illustrations to the right.
1. Here click Access Keys.
2. Then click on Create New Access Key button.
3. Press the Download Key File button.
4. Open the downloaded rootkey file. You will find your AWSAccessKeyId and AWSSecretKey inside. Use them to replace AWSAccessKeyId and AWSSecretKey in the following command
echo AWSAccessKeyId:AWSSecretKey > /etc/passwd-s3fs
you will get something like this:
echo AKIAJ2BIRJZ3E5JGXWSQ:SiOLlG9lKRPu0GoIQJHjHDgcH38BMo9p3386LRoG > /etc/passwd-s3fs
5. Copy-paste it into the terminal window and hit Enter button.
6. Now type chmod 600 /etc/passwd-s3fs in terminal window and press Enter.
7. Then type s3fs cloudtest8 home/s3 -o passwd_file=/etc/passwd-s3fs,nonempty and press Enter. Don’t forget to replace cloudtest8 with your S3 bucket name.
8. And type echo s3fs#cloudtest8 /home/s3 fuse _netdev,rw,nosuid,nodev,allow_other,nonempty 0 0 >> /etc/fstab and press Enter. Don’t forget to replace cloudtest8 with your S3 bucket name.
9. Once done, type mount -a and press Enter.
Congratulations! You are all set now. It’s time to test your connection.
10. Download WinSCP (or any other FTP client) and launch it.
11. Type in your Instance’s IPv4 Public IP address as Host Name. See Step.3.8.
12. Enter your Username, which is s3 in our case.
13. Input the password you ‘ve set in Step 4.2. and click Login.
13. Answer Yes when prompted.
14. Once you get connected, you’ll see that your s3 folder is empty. It’s time to put something in it.
16. Check your Amazon S3 bucket here: https://s3.console.aws.amazon.com/s3/buckets/ – the file is there! You can even try it vice-versa: upload a file in Amazon S3 bucket and get it from WinSCP.
You can also install Amazon S3 Browser https://s3browser.com/share-s3-bucket-edit-acls.aspx as an additional option to the get access to your cloud drive.
Now you can access your cloud drive from anywhere in the world. Moreover, you can set up your cameras and/or DVRs to record the videos to your cloud drive via FTP. And we’ll tell you how in the next article.
Comments: