IT in Education

Nextcloud AIO with Amazon Elastic Compute Cloud (EC2)

awsThere are a number of ways to install Nextcloud AIO (All In One) on AWS. This article describes the process of installing a single EC2 instance.


Be warned that once you start a server up, you will start to be charged in accordance with Amazon's pricing structure.  Once you've finished with a server instance make sure you stop the instance if you don't want to be charged.

  1. Start by logging on to AWS with an admin role.
  2. Go to Services > EC2.
  3. Go to Instances click Launch Instance.
    1. Enter a meaningful Name (e.g. NextcloudAIO).
    2. In the Application and OS Images (Amazon Machine Image) section, Search for Nextcloud and press Enter.
    3. Select the AWS Marketplace AMIs tab.
    4. Select the entry from Nextcloud GmbH (e.g. Nextcloud 0.9.1) and click Continue.
  4. Choose your Instance type (e.g. the default is t3.medium)
  5. Click Create new key pair
    1. Key pair name: NextcloudKey
    2. Key pair type: RSA
    3. Private key pair file format: pem
    4. Click Create key pair.
    5. This will download a file called NextcloudKey.pem
  6. Leave the Network settings at their default values.
  7. Change the Configure storage to 50GB of gp2.
  8. Click the Launch Instance button.

Click View instances to view your instance launching.

Configuration

Complete the following steps to access your newly created instance.

Initialise Nextcloud

You are now ready to access this Nextcloud instance by browsing to

  1. Browse to https://IP-Address:8080/
  2. Copy the Password that's displayed (e.g. amazingly easiness bats thank recant unreal exterior glutinous).
  3. Click the Open Nextcloud AIO login button.
  4. Paste the password and click Login.
  5. Click Update mastercontainer, if it appears.
  6. Enter a domain name that has an A record pointed to this IP address (e.g. cloud.myschool.org), and click Submit domain.
  7. Enter your Timezone, being careful to enter a correctly named timezone (e.g. Europe/London) and click the Submit timezone button. 
  8. Click the Download and start containers button.

Note that if you enable the optional addons ClamAV and Fulltextsearch, I found that I needed 8GB memory.

It might take several minutes to create and start the required containers. Once this process is complete you'll be presented with the initial admin password.

Access Nextcloud

You are now ready to access Nextcloud using your admin account.

  1. Browse to your domain (e.g. cloud.myschool.org).
  2. Username: admin
  3. Password: from the previous step.

Docker containers

Nextcloud is running in Docker containers. If you want to SSH access the container to edit the config.php file for example, do the following.

  1. Access your Nextcloud AIO server using SSH.
  2. Run the following command:

sudo docker exec -it nextcloud-aio-nextcloud sh

You will now be able to browse the web root directory, and edit the config.php file for example. You can also run OCC commands from here. Type exit to come out of the interactive session.


Thanks for visiting,
Steven