AWS Lightsail is the closest thing AWS has to shared hosting. It is their quick, easy and inexpensive off-the-shelf hosting that has SSH access and many of the benefits of using a more expensive EC2 instance.
It is an affordable entry in cloud computing, but is it any good?
I decided to try out Amazon’s cheapest hosting offering by moving a WordPress blog from some shared hosting to Lightsail. I have tried EC2 in the past so this was not my first experience with AWS, but I was curious to see what their new more consumer-based hosting was like.
When you create an instance of Lightsail you chose how big or small you want it, then you can have it pre-configured as a WordPress blog or several other applications. I went with the PHP 7 LAMP stack option in the smallest size ($3.50 per month). I chose this option because I wanted to make sure WordPress was exactly the way I wanted it.
The PHP version I received was PHP 7.1. But it’s possible to upgrade. In the
The main thing you can say about the setup is that it was
First Look at Lightsail
Having used AWS EC2 in the past so I knew that things might be a bit different with Lightsail compared with normal VPS hosting. The main difference you notice right away is that the default username is “
So, what is this Bitnami?
Amazon AWS has so many quirks that you might assume that Bitnami is an AWS thing, but it is quite widely used in cloud computing (including Oracle Cloud and Google Cloud Platform).
With Lightsail/Bitnami a lot of the things you normally have to do to set up a LAMP stack are already done for you. For example, Apache is pre-installed with most/all modules and even MySQL is pre-installed.
Transferring a Website to Lightsail
I basically followed my guide from here to move a WordPress blog over to AWS Lightsail with the WP-CLI. The previous hosting the blog was on was basically shared hosting with a few tweaks to it to make it slightly closer to a VPS, whereas Lightsail is basically a VPS with stabilizers on it.
As the instance is just going to be hosting one website I didn’t have to worry at all about the
My first question was how do I connect to MySQL. The login info for MySQL did not appear to be anywhere in the AWS console. To find the password for the root user you need the Bitnami Application password. From the home directory (where you arrive after logging in) just type…
$ cat bitnami_application_password
Transferring everything across, most things just worked. While PDO worked fine in normal PHP pages, I had to tweak the php.ini to get PDO to work from a script run in the CLI. For me, I just had to uncomment the .so file for PDO which was almost the last line of the
After changing something like the php.ini you’ll have to restart. The following command seems to stop everything (apache/HTTPd, PHP and MySQL, ), then restart everything; perfect for making sure everything gets restarted all at once but not very graceful (from here)…
$ sudo /opt/bitnami/ctlscript.sh restart
To just restart apache you’d just add “apache” to the end…
$ sudo /opt/bitnami/ctlscript.sh restart apache
While some things are very different in Bitnami, it’s basically just a Linux instance. I am most comfortable with Ubuntu/Debian and a lot of the standard CLI functions are exactly the same as Ubuntu. Nano comes pre-installed and was the default editor for the crontab.
$ crontab -e
* * * * * /opt/bitnami/php/bin/php -f /opt/bitnami/apache2/htdocs/scripts/index.php "name_of_method()"
$ sudo service cron reload
The timezone is quite important because it can also affect your keyboard layout when typing into the Linux terminal. Changing the timezone is based on Ubuntu 16.04, so something like this would work to list the timezones, select a timezone then check which timezone you’re using…
$ timedatectl list-timezones
$ sudo timedatectl set-timezone America/Vancouver
Now, that the Linux timezone is set, you may also need to update the timezone PHP uses by updating this line in the php.ini…
Something else that is the same as Ubuntu is…
$ sudo apt-get update
$ sudo apt-get upgrade
Once you get used to the different directory structure, everything is pretty much the same as Ubuntu.
Issue(s) with AWS Lightsail
The first “upgrade” was a large one which took a while. It took so long in fact that either putty went inactive, or my computer went to sleep, or both. After this, the website went down and I had no access to SSH. What I seemed to have to do was not “reboot” the instance, but “stop” and “start” the instance from the AWS console. After this, I had a different public IP address but I was able to fix whatever had happened with the upgrade.
If the restart is the opposite of graceful, stopping and starting was similarly very ungraceful, comparable to doing the same thing with any VPS instance.
Apart from some minor changes that will probably be easy to get used to, I did not have many issues at all.
AWS Lightsail: Conclusion
Basically, so far so good. The instance seems fast for a WordPress blog, it certainly is compared to the previous shared hosting.
I’m not 100% sure that the speed of setup of Bitnami is worth the changes it makes to the Linux operating system. It seems like Amazon are trying to make Linux Administration as easy and simple as possible by adding another layer of complexity. But I may change my mind. Pretty easy and fast on the whole.