Creating a LAMP/LEMP instance on Fuga Cloud with cloud-init

Creating a LAMP instance

Launching an instance (VM) on Fuga Cloud is very fast thanks to our SSD-drives. But without the software we need, the instance is nearly useless. Of course we can always install our software manually, but that’s cumbersome and error prone. Thankfully the Openstack platform and Ubuntu support cloud-init which enables us to attach an install-script to our instance. So when we launch our instance in Horizon, our software is automagically installed with it. Now we can immediately start focusing on using your software, instead of dealing with all the pains and horror of maintaining a server.

As a front-end developer, I preferably don’t want to have to deal with this as it’s not my area of expertise. When utilizing a cloud-init script, I don’t have to.

Now, back to the subject at hand. Because of the popularity of the LAMP stack, I’ve chosen to show you how to install a LAMP stack on an Ubuntu 16.04 instance.

Launching an Ubuntu 16.04 instance

Details section

First, we start with logging into Fuga Cloud and click on the Launch Instance button. A popup appears where we will have to fill in the details and specs of the instance in the Details section. Continue by giving your instance a name, ubuntu-lamp for example. For simplicity’s sake, we will leave the rest of the settings in the Details section the default values.

Source section

In the source section, we will pick the Ubuntu 16.04 LTS version. Among some other Linux distros, Ubuntu supports cloud-init.

Flavor section

Next, pick a flavor that will suit your needs. Because I’m Dutch, the smaller the better (read: cheaper).

Networks section

You can pick a network here, I guess any will do.

Security Groups

To be able to create an instance, you need to set up a security group. This is beyond the scope of this tutorial though. Read more about setting up a security group.

Key Pair section

Here you assign or create an SSH-keypair. We will need this to login to our instance from the terminal.

Configuration section

Here we can add our custom cloud-init script. I’ve took the liberty of creating a script you can use to install LAMP to the instance. Here goes: