EC2 Instance Setup
Launch and secure your Ubuntu EC2 instance to serve ownCloud or manage deployments.
To run ownCloud and serve as the interface for file uploads, we begin by launching and configuring an Amazon EC2 instance.
This chapter walks you through the creation of the EC2 instance, setting up the web server, PHP environment, and preparing it to host ownCloud.

Prerequisites:
An AWS account with access to EC2
Step 0: Create Key Pair and Security Group
0.1 Create a Key Pair
Go to EC2 Dashboard → Key Pairs
Click Create Key Pair
Set:
Name:
owncloud-key(or any name)Key pair type: RSA
Private key format:
.pem
Click Create key pair – the
.pemfile will download automatically
0.2 Create a Security Group
Go to EC2 Dashboard → Security Groups
Click Create Security Group
Set:
Name:
owncloud-sgDescription: OwnCloud Security Group
Under Inbound Rules, add the following:
HTTTP
TCP
80
Custom 0.0.0.0/0
Custom TCP
TCP
8000
Custom 0.0.0.0/0
All Traffic
All
All
Custom 0.0.0.0/0
Under Outbound Rules, add the following:
SSH
TCP
22
Custom 103.167.131.175/32
HTTP
TCP
80
Custom 0.0.0.0/0
HTTPS
TCP
443
Custom 0.0.0.0/0
Custom TCP
TCP
8000
Custom 0.0.0.0/0
Click Create Security Group.
Step 1: Launch EC2 Instance
Go to AWS Console → EC2 → Launch Instance
Choose:
Ubuntu 22.04 LTS (or Amazon Linux 2)
t2.micro (or higher)
Configure:
Add inbound rules for HTTP (80), HTTPS (443), SSH (22)
Launch the instance and connect using:

Step 2: Create Setup Script
To automate the LAMP stack and ownCloud setup, create a bash script.
Paste this script:
Step 3: Make the Script Executable
Run the script:
This installs:
Apache web server
MySQL (and sets up database, user, and password)
PHP 7.4 with required modules
ownCloud from the official source
Step 4: Access ownCloud from Browser
Once the script finishes, open your browser:
You’ll be greeted by the ownCloud setup page.
Step 5: Complete ownCloud Installation (GUI)
Fill in the following on the web setup screen:
Admin Username: Choose your own
Password: Set a strong one
Data Folder:
/var/www/html/owncloud/data
Step 6: Database Configuration:
Database Type: MySQL/MariaDB
Database Name:
owncloud_dbDB User:
owncloud_userPassword:
strongpasswordHost:
localhostClick Finish Setup
You are Done ✅
ownCloud will finish configuring and take you to the dashboard. You’re now ready to move on to the next steps:
Connect ownCloud to your deduplication API
Upload files → monitor Lambda triggers → S3 deduped storage
Visual Walkthrough: Installing ownCloud on EC2
Prefer to watch and follow along? This video walks you through launching an EC2 instance and setting up ownCloud step by step:
Last updated