Filezilla Ec2

  1. Filezilla Ec2 Windows
  2. Filezilla Ec2 Mac
  3. Filezilla Upload To Ec2
  4. Filezilla Ec2 Permission Denied

Posted:

I am running FileZilla FTP Server on an Amazon Web Services EC2 Windows Server 2012 Instance, and want to FTP in from my home PC using FileZilla Client. I followed these instructions, but using user Administrator in Step 7 together with the user's password: How to (S)FTP into your EC2 instance. In this guide, we will be using FileZilla. Connecting to your AWS EC2 instance using SFTP 1. (convert your keyfile): When you select the.pem file from within FileZilla, it should automatically be converted to.ppk. You include and convert the keyfile in Edit - settings. In this blog I will discuss a software allowing you to write your files on your windows machine using a text or other file and upload them to your EC2 instance in an easy and efficient way. Downloading FileZilla. FileZilla is a free software and I would recommend downloading it from the official website here: https://filezilla-project.org.

How to Deploy a Node.js Application or Website in EC2 instance?

Tags: AWS

Answer

In this post, I will show you how to deploy a node.js app (website) in AWS EC2 instance.

Creating a Simple Node.js App

Our Node.js App will contain two files:

  • home.html - Client-Side HTML file

    <!DOCTYPE html><html><head> <title>Welcome Home</title></head><body> <h2>Welcome Home</h2></body></html>
  • index.js - Server-Side Node.js file

    varexpress=require('express');varapp=express();app.get('/', function(req, res) { res.sendFile(__dirname+'home.html');});app.listen(80, function() { console.log('port is listening to 80');});

Sign-In to Your AWS Account

Lets go to https://aws.amazon.com/console/ and do any one of the following:

  • If you have an AWS Account - Click on the 'Already have an account? Sign in' link and Sign-In
  • If you do not have an AWS Account - Click on the 'Create a Free Account' button and then Sign-In

Now you will head towards the 'AWS Management Console' Page.

Launch an EC2 Instance

From the 'AWS Management Console page', click on ServicesEC2 (under Compute section).

Now you will head towards the 'EC2 Management Console' page. Before choosing anything, make sure that the deploy region is of your choice.

From the 'EC2 Management Console' page, click on InstancesLaunch Instance.

Now you will head towards the 'Launch instance wizard' Page. Do the following steps to launch an AWS EC2 instance.

Step 1: Choose an Amazon Machine Image (AMI)

Do the following steps:

  1. Click on the check box 'Free tier only'.
  2. Choose 'Ubuntu Server 18.04' (you are requested to choose latest version).
  3. Click on the check box 64-bit(x86)
  4. Click on 'Select' button

Step 2: Choose an Instance Type

Do the following steps:

  1. Choose 't2.micro' (Free tier eligible) instance.
  2. Click on the 'Next: Configure instance Details' button.

Step 3: Configure Instance Details

Leave everything as it is and click on the 'Next: Add Storage' button.

Points to be noted

  • You are free to choose the 'Subnet' of your choice or AWS will choose any available 'subnet' on behalf of you.
  • Make sure the 'Tenancy' is 'Shared - Run a shared hardware instance'.

Step 4: Add Storage

Leave everything as it is and click on the 'Next: Add Tags' button.

Step 5: Add Tags

Type key-Value name of your choice and click on the 'Next: Configure Security Group'.

Step 6: Configure Security Group

Do the following steps:

  1. In Assign a security group, choose 'Create a new security group'.
  2. In Security group name input box, type a meaning full name of your choice.
  3. In Description input box, type a detail information about the Security Group.

Now, add the following rules

TypeSourceExplanation
HTTPAnyWhereTo HTTP request
HTTPSAnyWhereFor HTTPs request
SSHAnyWhereTo upload files to EC2 instance (using Filezilla).
NFSAnyWhereTo share the files remotely (EFS)
Custom TCP RuleAnyWhereOne free port for testing (Not necessary)

Step 7: Review Instance Launch

Filezilla

Review all the details of your ec2 configuration and click on the 'Launch' button.

Download New key pair

Now, 'Select an existing key pair or create a new key pair' pop up will appear. Do the following:

  1. Choose the 'Create a new key pair' option.
  2. Type the name of your new key pair.
  3. Click on the 'Download Key Pair' button.
  4. After the download, the 'Launch' button will be enabled. Click on the 'Launch' button.

Points to be Noted:

  • Do not delete your 'key pair' file. Because it is the only way to access the EC2 instance you launched.
  • Do not share your 'key pair' file in any internet platform in any case.

Launch Status

Click on the 'View Instances' button.

Note: AWS will take at least 5 mins to launch your EC2 instance.

Hurray! Your EC2 instance was launched successfully.

Connect to Your Instance from Mac or Linux

To connect to your EC2 instance from Mac or Linux using a standalone SSH client. Do the following:

  1. Open your command line shell

  2. Change the directory to the location of the private key file that you created when you launched the instance.

  3. Use the chmod command to make sure your private key file isn't publicly viewable.

    For example, if the name of your private key file is myKey.pem, use the following command:

    chmod 400 myKey.pem

  4. Use the following SSH command to connect to the instance:

    ssh -i /path/myKey.pem [email protected]_dns_name

Connect to Your Instance from Windows

To connect to your EC2 instance from Windows using a standalone SSH client, you need 3 tools:

  1. PuTTY - To start, stop, delete, or restart your application remotely.

  2. PuTTYgen - To convert your myKey.pem file to myKey.ppk file. Because PuTTY and Filezilla accepts .ppk file only.

  3. Filezilla - To upload all your files from your PC to EC2 instance.

Download PuTTY for Windows

Download PuTTY for your windows (Mine is 32-bit).

Download PuTTYgen for Windows

Download PuTTYgen for your windows (Mine is 32-bit).

Download Filezilla for Windows

Download Filezilla for your windows (Mine is 32-bit).

All required software to connect to Amazon EC2 instance from your windows is downloaded and installed.

Convert .pem file to .ppk file

To Convert your myKey.pem (that you created when you launched the instance) to myKey.ppk. Do the following:

  1. Open PuTTYgen and click on the 'load' button.

  2. Change the file type to 'All Files('.')' and locate your myKey.pem file.

  3. Click on your myKey.pem file. Now, the PuTTYgen Notice dialog box appears, click on the 'OK' button.

  4. Now, click on the 'Save private key' button.

  5. Now, the PuTTYgen Warning window appears, click on the 'Yes' button to save your key file without a passphrase to protect it.

  6. Type the ppk file name of your choice and click on the 'Save' button.

  7. Hurry! you have converted your myKey.pem file to myKey.ppk file successfully.

Setting up Filezilla

Now we will set up Filezilla to upload our local files to the EC2 instance. To do so, please follow these steps:

  1. Open up filezilla and click on the menu FileSite Manager...

  2. The 'Site Manager' Pop up window will appear. Click on the New site and type the name of your choice.

  3. From the same window, do the following configuration:

    • Protocol ⟶ 'SFTP - SSH File Transfer Protocol'.
    • Logon Type ⟶ 'Key file'
    • User ⟶ 'ubuntu'
    • Key file ⟶ Locate your myKey.ppk file by clicking on the 'Browser..' button.
    • Host ⟶ Your EC2 instance 'Public DNS (IPv4)' name (follow next step).
  4. Open up your EC2 instance Page from 'AWS Management Console' and do the following:

    1. Click on the Instances on the left side menu.
    2. Click on the Instance that you want to connect from Filezilla.
    3. Click on the Description tab in the bottom menu.
    4. Copy your Public DNS (IPv4) name.
  5. Now paste the copied value to the Filezilla Host input box and click on the 'connect' button.

  6. Now, the 'Unknown host key' window will appear. Tick the checkbox and click on the 'OK' button.

  7. Hurray! You are connected to your EC2 instance via Filezilla.

Download

Setting up PuTTY

Now we will set up PuTTY to access your EC2 instance. To do so, please follow these steps:

  1. Open up PuTTY

  2. Find your Host Name in your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.

  3. The 'Connect to your instance' pop up appears. Copy the Host Name starting from '@'.

    My Host name is '@ec2-3-81-164-1.compute-1.amazonaws.com'

  4. Now paste the copied host name to the PuTTY.

  5. Now click on the 'Data' menu under 'Connection' section in the left side menu.

  6. To fill the Auto-login username, find your user name from your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.

  7. Copy your EC2 instance 'username'. In most cases your username will be 'ubuntu'.

  8. Paste your username in the 'Auto-login username' input box of PuTTY Configuration.

  9. Expand 'SSH' menu under 'Connection' section on the left side menu.

  10. Click on the 'Auth' menu under 'SSH' section and locate your myKey.ppk by clicking on the 'Browse..' button.

  11. Move to 'Session' section in the top of the left side menu and do the following:

    1. Type the session name of your choice.
    2. Click on the 'Save' button.
  12. PuTTY Configuration is over. To Connect to your EC2 instance via PuTTY. Do the following:

    1. Open PuTTY
    2. Click on your Saved Sessions Name
    3. Click on the 'Open' button
  13. Hurray! PuTTY is connected to your EC2 instance.

    Note: If your PuTTY is not connecting automatically. Please type your username ('ubuntu') manually or delete the saved session and reconfigure your PuTTY will fix it for you.

Setting up Node.js Environment

In this section, we will setup Node.js environment for your EC2 instance. To do so, please follow these steps:

  1. Connect to your EC2 instance via PuTTY (saved session).

  2. Type the command 'curl -sL https://deb.nodesource.com/setup_10.x sudo -E bash -' and press the 'Enter' key to install NodeSource Node.js 10.x repo.

  3. Type the command 'sudo apt-get install -y nodejs' and press the 'Enter' key to install Node.js.

  4. Type the command 'sudo npm i express' and press the 'Enter' key to install express.js.

  5. Type the command 'sudo npm i -g pm2' and press the 'Enter' key to install pm2.

Node.js Environment is setup successfully.

Create Directory in your EC2 Instance

Create a directory ('new-website') by using the command 'sudo mkdir directory-name'.

Give Permission

Give permission to ('new-website') folder by using the command 'sudo chmod 777 /home/ubuntu/new-website', this will allow filezilla to upload your local files to that remote folder.

List Directories in you EC2 Instance

List all directories by using the command 'ls'.

Filezilla Ec2 Windows

Upload Files to EC2 Instance

To upload all your files to EC2 instance. Do the following:

Filezilla Ec2 Mac

  1. Open Filezilla and connect to your EC2 instance.

  2. Once successfully connected. Open the 'new-website' folder in 'Remote site' section.

  3. Select all your required files from the 'Local site' section , right-click it and upload the files.

  4. Now, all the uploaded files will appear on your 'Remote site' which indicates that the files are in your EC2 instance.

    Close the filezilla.

  5. For verification, lets check from PuTTY. To do so, please follow these steps:

    1. Open PuTTY and navigate to the 'new-website' folder using the command 'cd new-website'.

    2. Type 'ls' command to list all the files in the 'new-website' folder.

      Yes, the files are available.

  6. Lets start our Node.js app using pm2.

    Type 'sudo pm2 start test.js' command to start your test.js application.

    Note: Make sure you are the in 'new-website' folder.

    pm2 will display the status ('online') of the app your are running.

  7. Open your 'AWS Management Console' and do to following:

    1. Navigate to the Instances.
    2. Click on the instance you are running the app
    3. Copy the Public DNS (IPv4) value.
  8. The copied Public DNS (IPv4) value is the URL. Paste the URL in your favorite web browser and press 'Enter' key.

    Hurray! your Node.js website/app is live forever.

Related Tutorial

Filezilla Upload To Ec2

Learn Node.js

Filezilla Ec2 Permission Denied

Home‎ > ‎Amazon web services (AWS)‎ > ‎Elastic Compute Cloud (EC2)‎ > ‎

Connect to EC2 instance using SCP or FileZilla

Advertisement:
Canagon.com - Website for $499, beautiful premade designs, high-performance hosting on all continents, dedicated support team. Learn more >

There are many ways to upload file to your AWS EC2 instance, I choose always one of these two, because they make use of the key pair file, and both are easy and secure.
Cisco anyconnect vpn client download.

Commandline

Assuming you have a Key Pair file .pem already created in EC2 management console, use this command to upload file to your remote machine (EC2 instance). I am running Ubuntu Server 12.04.2 LTS 64 and scp was already pre installed.
$ scp -i ec2.pem file_to_upload.txt [email protected]:/home/ubuntu/

-i option for using the key is followed by path to key file-name, where ec2.pem should be name of your key file, this command works only if you are in the directory where .pem file is stored, otherwise use full path like /home/Downloads/your_key_name.pem ..
Continue with path to the file you wish to upload, follow with [email protected]_dns_hostname and then input ':' and follow with destination path on remote server (EC2 instance), beware not to use blank space after colon, otherwise you will get error.

GUI with FileZilla

In FileZIlla, open from menu Edit > Settings > Connection > SFTP > Add keyfile..

You will be asked to convert key to other format, agree with OK.
Exit settings.
Go to Site manager. As Host enter your Public DNS from EC2 management console > Instances > Description. Choose SFTP - SSH File Transfer Protocol, input user ubuntu, which is default on Ubuntu AMIs (or whatever is your username after you logon to EC2 instance) and click connect.
You may be prompted to accept public key, that is all.

File permissions for .ppk file and it's folder

Folder in which .ppk file that I converted from .pem resides is chown 750 and file is chown 600, this way it works without complaining about Error: Pageant failed to answer challenge or Could not connect to server, these error messages disappear whet permissions are set correctly, also some error messages could appear when connecting using ssh -i, if your .pem file is not chmod 600.
Advertisement:
Create your website, $499 / year, hosting included, choose your design and domain, enter content we'll take care of the rest. Learn more >