Setup on-premise NFS file share using AWS File Gateway

AWS File gateway, running as a VM server locally, can act as a NFS or SMB file share to actually store your files at AWS S3. Your on-premise machines can then connect and mount the file share to access data stored at S3 as if they are available locally.

This can be a great first step in migrating infrastructure to the cloud.


  • Virtualization Platform (e.g. Hyper-V or VMware ESXi) to host the File gateway VM. This guide will use VMware ESXi as the platform for demonstration.
  • AWS account ready to use

Installing File Gateway Virtual Machine

  • log in to AWS Management Console
  • go to service Storage Gateway
  • click on Create gateway
home screen
  • select File gateway
  • click Next
select type
  • select VMware ESXi
  • click Download image to get the VM image file
  • click Next
host platform

An ova file called aws-storage-gateway-latest.ova should be downloading. While downloading, let’s continue a little bit.

  • select Public for Endpoint type
  • click Next
endpoint type

You will arrive at the the Connect to gateway screen, asking you for the gateway IP address. We will need to finish the download and install the gateway first.

Once download is completed, deploy the VM from the downloaded OVA file. Once the deployed, the running gateway VM should look like this:


Note the IP address, we can now go back to the Connect to gateway screen and enter the IP address and click Connect to gateway

enter IP

If everything goes well, the next screen Activate gateway screen would show:

  • select your time zone
  • enter a name for the gateway
  • click Activate gateway

Once activated, you will be shown the following screen:


It is recommended to add a cache to the file gateway for low latency access to your most recently used data. To do that, add a 2nd hard drive (AWS recommends minimum of 150GB) to the file gateway VM and then click on Refresh at the Configure local disks screen. The disk should show up. Now click Configure logging.

  • select desire logging
  • click Exit or
  • click Verify VMware HA if you have VMware HA configured

The AWS file gateway has setup successfully.

Create NFS file share

With the file gateway up and running, you can now create file shares (Yes, you can create several file shares, each use a different S3 bucket)

  • click on Create file share
  • enter S3 bucket name to map to
  • select Network File System (NFS)
  • select Gateway just created
  • click Next
create share
  • click Next on next screen
  • click Create file share
create share success

With a file share created, you can now mount the file share to your machines. Click on the newly created share. It will shows the details about the share and at the bottom of the screen shows the example commands to mount the file share.

  • Linux: mount -f nfs -o nolock,hard <ip-addr>:/<s3-bucket> <mount-path>
  • Windows: mount -o nolock -o mtype=hard <ip-addr>:/<s3-bucket> <drive-letter>:
  • macOS: mount_nfs -o vers=3,nolock,hard -v <ip-addr>:/<s3-bucket> <mount-path>

That’s it! File sharing with data stored at S3 bucket is ready!

Note: for ubuntu, package nfs-common is required (sudo apt-get -y install nfs-common).

Final Note

The file gateway VM has a default credentials of admin:password. For security purpose, it’s best practice to change it to a strong password.

Leave a Reply

Close Menu