lightsail graphic

Magento 2 on Amazon Lightsail

At the Amazon Web Services conference AWS revealed their newest product offering – Lightsail. Lightsail is an inexpensive managed Virtual Private Server (VPS) platform meant to rival the offerings of traditional VPS hosting competitors like Digital Ocean. Built on the Bitnami app engine (which itself is built on containers with Docker) you can one-click start an instance with apps pre-installed. This means low-cost one-click installations for Magento 2, WordPress, Drupal, Gitlab, and many more types of applications.

Up and running

AWS Lightsail makes it dead-simple to start up a new Magento 2 instance. After logging into the AWS console you can select Lightsail from the services menu. This launches a quickstart where, from the front page, you can launch an App + OS instance.

Amazon Web Server LightSail Create an Instance

 

After launching the App you choose a pricing plan. The rates are incredibly competitive – you get the same amount of RAM and a larger Hard Drive than with traditional AWS EC2 instances – the smallest of which at the moment is a t2.nano clocking in at 512MB RAM/1vCPU and 8GB SSD by default. That instance will cost you $4.75 on-demand but you get all the hassle of managing and installing your own applications. Lightsail is also offering the first 30 days free on the $5/month plan.

Amazon LightSail Choose Your Plan

 

After a little bit of loading you get the public IP address of the newly installed Magento 2. Loading that in a browser took me to the home page of my newly installed Magento 2 instance. It’s a baseline Magento 2.1.2CE (so it’s up to date on security patches).

Magento 2 Luma Theme

 

Right out of the box it doesn’t include any pre-installed sample data. It does have the Bitnami quickstart icon in the bottom-right; which takes you to a page to get the password for login. This is where the “easy” ends; at least for Magento 2.

Bitnami Cloud Image for Magento

The Bitnami instructions to obtain the Magento 2 password  appear to be written for Magento 1. They also focus on the fact that you’re likely running this as a Docker instance on either Amazon’s Elastic Container Service or as a guest OS on an EC2 instance. This is cause for frustration for a multitude of reasons.

First, the password is automatically generated for the Magento 2 admin user. To get this password you have to be able to read the system start log. If this were on EC2 this would be no problem – as a right-click in the AWS console on the instance has an option to read the system log. Unfortunately Lightsail at the time of this writing doesn’t have this ability. Second, the new admin user email defaults to “[email protected]” – so clicking the forgot password functionality wouldn’t work. This is difficult because Lightsail doesn’t configure Amazon’s Simple Email Service (SES) by default or open up the restrictions that Amazon places on sending emails from its AWS service – so it automatically black-holes any emails coming from the instance.

At this point you need to dive into the admin console of Lightsail to find the SSH key. To do this you’ll need to log into the instance and add a new Magento user from the command line tool:

> php -f bin/magento admin:user:create

Magento Admin:User:Create

This is where the Magento 2 developer experience requires some in-depth knowledge. You’ll be greeted with a warning that you didn’t provide all of the right parameters to the user creation method of the command line tool. Now we have to look to the Magento 2 Developer Docs… and eventually I found all the right commands – available here.

> php -f bin/magento admin:user:create –admin-firstname=Phillip –admin-lastname=Jackson –[email protected] –admin-user=pjackson –admin-password=abcd1234

Since I was already logged in to the SSH console I removed the Bitnami banner on the homepage. It took some time to find the command to do that, but here it is:

> sudo /opt/bitnami/apps/magento/bnconfig –disable_banner 1

I then clicked on forgot password and tried to issue a reset password email – but the email was still not working correctly. Which meant I needed to install sendmail, postfix, SES, and more all to get basic functionality. I’ll expand more on that point in future blog post.

Once I logged into Magento 2 things became much simpler. I was able to link my Magento Connect developer keys and download packages from the Magento Marketplace with no issues. I found no further roadblocks; and I didn’t experience any permissions issues. For a $5/month VPS the admin panel felt FAST; of course I was the only person using it. Don’t expect to be able to upgrade, though, as you need a minimum of 768MB of RAM available for Magento 2 to run the software updater. More on this in a future blog post.

Conclusion

In addition to installing Magento 2 on Lightsail I also installed a WordPress instance. The experience was much simpler, though I had similar issues with both email and getting the password to connect to the admin panel. However – WordPress comes with docs that actually line up with the admin experience and are easy to follow. The Magento 2 Lightsail/Bitnami docs do not. WordPress comes configured with an SMTP plugin where you can plug in SES credentials (and the docs walk you through how to do that) – Magento 2 does not. I did not do any benchmarking (that’s for another blog) and I believe that it would likely perform poorly under load – but with one-click upgrade capability up to 8GB / 2CPU machine (at $80/month) Lightsail can scale with a store.

For a product aimed at the DIY tier of the market Lightsail is compelling – but the Magento 2 experience has some pitfalls. This still needs to be fine tuned to be useful for the former Magento 1 CE market. That said, there is massive potential for those who want to test out Magento 2 without going through the hassle of installing it.

Written by: Phillip Jackson, Ecommerce Evangelist – 4 minute read