In this article we will see how to deploy a website with AWS Lightsail, and in the specific a WordPress website using macOS.
AWS (Amazon Web Services) Lightsail is a cloud computing service that you can use to host web applications and website. The technology provides the simplest way to manage Virtual Private Servers. This hosting service makes it simple for the users to deploy and operate WordPress websites, among others, for a fixed monthly price.
To deploy your website you'll need:
Once you sign up with Amazon Lightsail, you can create your lightsail instance. By clicking on ‘change AWS Region and Availability Zone’ you can select your favourite instance location. You will be prompted to select an Operating System platform. Linux works well for web servers unless you specifically want to use Microsoft technologies such as asp.net.
On the ‘select a blueprint’, you can choose an operating system only or an OS bundled with packages such as WordPress. An OS only blueprint is more flexible because it allows you to customize package installation. For the purpose of this article, we will select WordPress.
Generate an SSH key by clicking on ‘Change SSH key pair’ and again on ‘Create New’. Save it somewhere on your computer. There’s also the option to add a launch script that does things like add software, update software, or configure your instance in some other way.
Towards the bottom of the screen, choose a plan for your instance, the $3.5 will work well, plus you’ll get one month for free. At this point, name your instance and click ‘Create’. Your instance will be created and it will take a few seconds to switch from pending to running status.
Up to this point, you only have an operating system on your instance. We need to attach an IP address to it so we can access the webpage on the browser. Go to networking and click on ‘Create static IP’, here you need to select the instance you’ve created before. Give your IP a name or leave it as it is, then click ‘Create’.
Cyberduck is a FTP (File Transfer Protocol) used for the transfer of computer files between a client and server on a computer network. You can download it for free.
A prompt message will show up saying “Unknown fingerprint”. This is because it’s the first time you connect to the server. A list of folders will show up. Go on Apps -> WordPress -> htdocs. What you’ll need to do now is to drag the content of wp-content of your WordPress website to the wp-content on Cyberduck.
While Cyberduck is transferring the files, open Sequel Pro and create a new connection by clicking on the + symbol on the left bottom of the application window. From the menu list on top select SSH and let’s see how to fill the requested fields:
Now you’ll have to import the database that you have previously exported. Otherwise how is your website gonna show all the content you've updated on WordPress, duh?
Finally, the last step to take is to synch the security salt. Download the wp_config.php file from Cyberduck. Now open the wp_config.php file in the WordPress folder of your website. In this file find the ‘Authentication Unique Keys and Salts’ and copy all the define keys. These lines need to replace the same lines of the wp_config.php file that you have previously downloaded from Cyberduck. Save the file and upload it again on Cyberduck replacing the old wp_config.php
Congratulations! You’ve deployed your WordPress website.