logo
Menu

Wordpress in the Cloud on the cheap | S02 E27 | Build On Weekly

How do you get that WordPress website up and running on the cloud?

Darko Mesaros
Darko Mesaros
Amazon Employee
Rohini Gaonkar
Rohini Gaonkar
Amazon Employee
Published Aug 31, 2023

Screenshot of Rohini and Darko, while Darko is holding a 'for dummies' book
WordPress for Darko

How do you get that WordPress website up and running in the cloud? Do you use an EC2 instance? Do you use containers? Or maybe something completely different. In today's episode, Rohini and Darko are joined by Sophia as we try to achieve this goal in a couple of ways.

First we take a simple approach and set up WordPress on an AWS EC2 instance. This gives a flexibility to approach this problem from many directions, as we have the entire virtual server to ourselves. Today we have decided to host our WordPress website using Docker, specifically Docker Compose. As that allows us to host multiple different WordPress websites (maybe even different versions) on the same server.

Here is the docker-compose.yml file we used for today's deployment:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=hunter2
- MYSQL_PASSWORD=wordpress
expose:
- 3306
- 33060
wordpress:
image: wordpress:latest
volumes:
- wp_data:/var/www/html
ports:
- 80:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=hunter2
- WORDPRESS_DB_NAME=wordpress
volumes:
db_data:
wp_data:

But make sure to check out the full guide Darko has followed here.

Now, if you really do not wish to bother with an EC2 instance, and just want a WordPress website (but still have all the benefits of running it in the AWS Cloud), look no further than Amazon Lightsail. The place to run your WordPress workloads 👏 And Sophia, not only showed us how to get a WordPress instance running but also how to secure it, and set up automatic updates! Wonderful.

Screenshot of the WordPress creation screen on Amazon Lightsail

Check out the recording here:

Reach out to the hosts and guests: