To begin using Amazon EC2, navigate to the AWS Management Console, select “Services,” and click “EC2” under the Compute category. Launch a virtual server, referred to as an Amazon EC2 instance, by clicking “Launch Instance.”
Step 1: Choose an Amazon Machine Image (AMI)
An AMI acts as a blueprint containing the software setup (operating system, application server, and applications) needed to start your instance. You can choose from AMIs provided by AWS, the user community, the AWS Marketplace, or your own custom AMIs.
Step 2: Choose an Instance Type
Amazon EC2 offers a diverse selection of instance types tailored for various use cases. These instances, essentially virtual servers capable of running applications, come with different combinations of CPU, memory, storage, and networking capabilities. This allows you to select the appropriate resource mix for your applications. For more details on instance types and their suitability, refer to this link.
Step 3: Configure Instance Details
Customize the instance to align with your requirements. You can launch multiple instances from a single AMI, utilize Spot Instances for reduced pricing, assign access management roles, and more.
Step 4: Add Storage
Your instance will launch with default storage device settings. You can add extra EBS volumes and instance store volumes to your instance or modify the root volume settings. Note that additional EBS volumes can be attached after launch, but instance store volumes cannot. Learn more about Amazon EC2 storage options here.
Step 5: Add Tags
Tags are case-sensitive key-value pairs, such as “Name” as the key and “Webserver” as the value. You can apply tag copies to volumes, instances, or both. Any tags created will be applied to all instances and volumes. For more information on tagging Amazon EC2 resources, visit this link.
Step 6: Configure Security Group
A security group functions as a set of firewall rules governing traffic flow to your instance. On this page, you can specify rules to permit specific traffic. For instance, when setting up a web server requiring internet access, add rules allowing unrestricted HTTP and HTTPS port access. You have the option to create a new security group with specific ports (SSH as 22, HTTP as 80, Custom TCP as 8080) or choose from existing ones. To understand Amazon EC2 security groups better, refer to this link.
Step 7: Review Instance Launch
Before proceeding, review your instance launch details and make any necessary changes. To assign a key pair and finalize the launch process, click “Launch.” You will be prompted to select an existing key pair or create a new one, which you can name (e.g., “kohademo”) and download. A key pair comprises a public key stored by AWS and a private key file stored securely by you. This pair enables secure connection to your instance. For Windows AMIs, the private key file helps retrieve the instance login password. For Linux AMIs, it facilitates secure SSH access. Clicking “Launch Instance” will direct you to the instance dashboard. To connect, click “Connect” next to the launched instance.
You can connect to your instance using either a standalone SSH client or a Java SSH client directly from your browser (requires Java).
To access your instance:
- Open the terminal and execute the command: sudo su
- Enter the system password.
- Locate your downloaded private key file (“kohademo.pem”). The wizard usually auto-detects the launch key.
- Navigate to the Downloads directory: cd /Downloads
- Ensure your key is not publicly viewable for SSH to function correctly.
- If required, use this command: chmod 400 kohademo.pem
- Connect to your instance using its Public DNS: ssh -i “kohademo.pem” ubuntu@ec2-13-126-119-166.ap-south-1.compute.amazonaws.com (Note: Your Public DNS will be different).
You are now logged in as the root user on the AWS server and can proceed with installations such as Koha, DSpace, GreenStone, etc.