NextCloud on AWS
- Create EC2 instance
- Choose latest Ubuntu LTS image w/ any machine type
- Allow port 80 (HTTP) to your IP
- Launch instance and connect via SSH
- Run updates:
sudo apt update && sudo apt upgrade -y
- Accept any defaults
- Install NextCloud
- On Ubuntu:
sudo snap install nextcloud
- Browse to your instance’s public URL (may need to wait a few minutes)
- Create admin user and password
- Wait for initialization to finish
- On Ubuntu:
- Set up desktop sync (optional)
- Download and install NextCloud app (if not already installed)
- Connect to your instance’s public URL (use “http://”)
- Initial connection may fail – if so, retry with unsecured HTTP
- You may need to grant access to the client by logging in again
- Set up external storage (optional)
- Enable “external storage support” plugin in NextCloud
- Add S3 permissions to your user in IAM if it doesn’t already have them
- Create “s3” group (IAM -> Groups)
- Give it the “AmazonS3FullAccess” policy
- Add your user to the new group (IAM -> Users)
- Create Access key (IAM -> Users -> your user -> Security Credentials)
- Save Access key ID and secret access key
- Configure S3 external storage in NextCloud (Settings -> Administration -> External storages)
- Use “/” as folder name if you want all files to be stored in S3
- Pick a bucket name (do not create bucket in S3 first)
- Use Access key ID and secret access key from IAM
- Set region if desired
- Leave everything else at the defaults and click checkmark
- Add new files to external storage folder (may need to enable folder sync in client)
- Confirm new files are present in new S3 bucket
- Set up permanent IP (optional)
- Allocate new Elastic IP and assign to your EC2 NextCloud instance
- Re-connect via SSH to new IP (previous step will kill old connection)
- Edit
/var/snap/nextcloud/current/nextcloud/config/config.php
and add your IP totrusted_domains
- Restart Apache:
sudo systemctl restart snap.nextcloud.apache.service
- Set up HTTPS (optional)
- Modify security settings for instance and enable HTTPS access to your instance
- If you have a domain pointed to your instance:
- Modify security settings for instance and enable HTTP and HTTPS from anywhere
- Enable HTTPS:
sudo nextcloud.enable-https lets-encrypt
- Alternative, use self-signed cert:
sudo nextcloud.enable-https self-signed
If you’re using Google Cloud Platform:
- Enable interoperability in Google Cloud settings
- Create access key/secret
- Create Google Cloud bucket
- Configure S3 external storage in NextCloud
- Hostname: storage.googleapis.com