Create your e-commerce website for test automation using Amazon Lightsail and PrestaShop
Tags: testing, tutorial, aws, cloud
Published: 2022-09-06 15:22:20

For most test automation engineers, it is necessary to have a demo website in order to simulate a real website including different functions and elements. 

The majority of these websites are e-commerce websites because they have different features and you can automate the whole process and placing an order and create E2E scenarios from logging in to checking out. 


## What is the problem? 

If you start practicing with a demo website, you may find the website is down the following day or week, and you cannot continue. 

Because of that, I will show you how to create your own e-commerce website using [Amazon Lightstail](https://aws.amazon.com/free/compute/lightsail/) hosted on AWS and [PrestaShop](https://www.prestashop.com/).

Sounds interesting! 

Let's get started 🚀


## What is Amazon Lightsail?

[Amazon Lightsail](https://aws.amazon.com/free/compute/lightsail/) is the easiest way to get started with AWS for developers, small businesses, students, and other users who need a solution to build and host their websites and web applications in the cloud. 

Lightsail provides developers compute, storage, and networking capacity. Lightsail includes everything you need to launch your project quickly – virtual machines, containers, databases, CDN, load balancers, DNS management etc. – for a low, predictable monthly price. - Source: [Amazon Lightsail FAQs](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-frequently-asked-questions-faq#amazon-lightsail-frequently-asked-questions-faq-general_)


![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8r52kxh2s7x5llk9ocwc.png)


To start using Lightsail, choose [Get Started](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?client=lightsail) and log in. You use your Amazon Web Services account to access Lightsail; if you don't already have one, you'll be prompted to create one.


## Create your e-commerce website

1- Login with your AWS account and from the dashboard, select Amazon Lightsail service

![21](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbznsgb94ec83gei7m1o.png)

2- Click on Create an instance

3- You can change the AWS Region and Availability Zone based on your preferences

![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9oj7cr6cx0dszyvseiz.png)

4- Pick your instance image in our case we will select Linux VM 


![3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gf9rpthw3jooaslrbvan.png)

5- Select the blueprint and in our case we will choose Prestashop from the Apps + OS

![4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0stnfzfx5pk1mjwqwyw9.png)

6- You will connect to your instance using the default SSH key or you can create a new one 


![5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r35291z3e4ugpvcka7n6.png)

7- There is an option for the automatic snapshot but we can leave it for now and you can enable it afterwards. 

8- Select the price tier but I will leave the default one. For a limited time, new Lightsail customers can try the selected plan for free for three months andn after that you can pay only 3.5 USD. Read more about the Lightsail pricing from [here](https://aws.amazon.com/lightsail/pricing/)


![6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unieu0v2htiymffkbm18.png)

7- Rename the instance name to be for example MyShop and click on Create instance button


![7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ptc07wtsjdb5scwwboac.png)

8- Wait till the VM status to be running 

![8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51lk3mf0a0y8wofwntwp.png)

9- Now you can access the the VM using SSH 

![9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hc356xmbzu5gzaiqujnr.png)


![9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t22pedsd98vixtdc0ntr.png)

10- After you're connected, enter the following command to get the default application password:

`cat $HOME/bitnami_application_password
`
Save the password because you will use it to login as an administrator


For more information you can check the [start guide for PrestaShop on Amazon Lightsail](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-quick-start-guide-prestashop)

11- Now you can open the instance with the public IP 


![10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkmasxs3cymxexfawnkr.png)


![11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sla6vbvkp57ln8009mrp.png)


![12](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eveglqk8gdudtzgw79o6.png)


![13](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gl3giu2qemor8jgqpe9j.png)

12- If you want to login as an administrator you can use the following details: 

URL: http://[YOUR_PUBLIC_IP]/administration
Username: user@example.com
password: YOUR_PASSWORD

![14](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9e4o8zl6yz1x4cwk3tp5.png)

![15](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yi07cjb7czeqii53mrj.png)

Congratulations 🥳 , you now have your own e-commerce website where you can run your test automation scripts. 

## What's next?
Amazon Lightsail give you the ability to create and attach a Static IP, add additional storage, create a snapshot, check the Metrics and more. 


![16](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/928vlibvcbv64ojccwe9.png)


![17](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2kv7dozto2f5p4yulzih.png)


![18](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkf24wokj3v7np29g8kl.png)


![19](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jk86d1f8qh2xrxqftqyy.png)

And if you don't need the VM anymore you can delete it. 

![20](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1wazznqprzxao3tw6yb.png)


## Resources

- [Frequently Asked Questions in Amazon Lightsail](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-frequently-asked-questions-faq#amazon-lightsail-frequently-asked-questions-faq-general)

Thanks for reading and happy testing! 🚀