Creating Your Own Private Cloud Storage with AWS EC2 and Nextcloud

Introduction

Cloud storage has become an integral part of our digital lives, offering a convenient and accessible way to store and access our files. While many people rely on commercial cloud storage providers, some prefer to maintain more control over their data by setting up their private cloud storage. In this blog post, I will guide you through the process of creating your private cloud storage using Amazon Web Services (AWS) EC2 instances and Nextcloud, a popular open-source cloud storage solution.

Prerequisites

Before we dive into the installation process, you’ll need to gather the following prerequisites:

  • An AWS account.
  • Basic knowledge of AWS services.

Setting Up an AWS EC2 Instance

  1. Log in to your AWS Management Console and navigate to the EC2 dashboard.
  2. Launch an EC2 instance:
    • Choose an Amazon Machine Image (AMI). In this post, I will use Ubuntu Server 22.04 LTS.
    • Choose a defalut instance type which is t2.micro (Free tier eligible)
    • Configure the instance details as per your requirements.
    • Create a key pair
    • Allow SSH, HTTPS, and HTTP traffic
    • 30 GiB for boot volume in storage configuration
    • Launch instance
  3. Assign Elastic IP address
    • In the EC2 Dashboard, locate “Elastic IPs” on the left-hand navigation pane.
    • Click on “Allocate new address” to create a new Elastic IP address.
    • Once you’ve allocated an Elastic IP address, it will appear in the list. Click on it to select it.
    • In the Elastic IP address details page, click on the “Actions” button at the top, and then select “Associate IP address.”
    • In the “Associate Elastic IP address” window, select the EC2 instance to associate the Elastic IP address with from the drop-down list.
    • Click the “Associate” button to confirm and complete the association.

Connect to your instance and install Nextcloud

  1. Connect to your instace from AWS

2. following these commands for installing Nextcloud

  • Update the package repository and upgrade the system:

sudo apt update
sudo apt upgrade -y

  • Install Nextcloud using Snap:

sudo snap install nextcloud

  • Check the status of the Nextcloud snap installation:

snap changes nextcloud

Now, to access your Nextcloud instance, follow these steps:

3. Visit your instance’s IP address in a web browser:

http://your-instance-public-ip

4. You should see the Nextcloud login page. Create an admin account:

  • Enter the desired username and password for your Nextcloud admin account.
  • You can also set the data folder location, or you can accept the default.

5. Click Finish setup to complete the Nextcloud setup.

You should now have a working Nextcloud instance set up on your AWS EC2 instance. Remember to properly secure your instance, and consider using an Elastic IP address, as mentioned in a previous response, to ensure a stable public IP for your Nextcloud server.

Leave a Reply

Your email address will not be published. Required fields are marked *