All 42 projects

42 Project brief

cloud-1

Automated deployment of a WordPress site to AWS: Ansible creates the server, installs Docker and brings up Nginx with HTTPS, WordPress and MariaDB, ready to use without a single manual step.

My role
Ansible, containers, deploy
Team
2 developers
Validated
Apr 2025
Workload
100 h

The project

cloud-1 takes the Inception project, a WordPress stack in Docker, and moves it to a real cloud server with automation. The deployment must run without manual steps, and the site must keep its data and come back on its own after a reboot.

I automated it with Ansible: one playbook creates the EC2 instance, a second one configures it and starts the containers.

The team’s stack

  • Ansible
  • AWS EC2
  • Docker
  • Docker Compose
  • Nginx
  • WordPress
  • PHP-FPM
  • MariaDB
  • OpenSSL
  • WP-CLI

My part

I wrote 50 of the 56 commits: the server configuration, the containers and the deployment. My teammate worked with me on the EC2 provisioning playbook.

01

Provisioning on AWS

An Ansible playbook that creates the server itself, built together with my teammate.

  • Creates an EC2 instance with its key pair, security group, image and region taken from variables
  • Waits until SSH answers, then writes the new public IP into the inventory for the next playbook
02

Server configuration with roles

Five Ansible roles that turn a fresh Ubuntu server into a running site.

  • common installs Docker Engine and the Compose plugin from Docker’s signed APT repository
  • database and wordpress ship each service’s build files and create the data directories on the host
  • deploy builds and starts the stack, then nginx pushes the final config into the running container and reloads it
03

Three containers

Nginx, WordPress and MariaDB with Docker Compose, each in its own container.

  • Nginx is the only entry point, on ports 80 and 443, and passes PHP requests to WordPress’s PHP-FPM over FastCGI
  • The database and the WordPress files live on the host, so data survives rebuilds and reboots
  • Every container restarts automatically when the server boots
04

HTTPS & WordPress setup

A site that is ready the moment the containers start.

  • A self-signed TLS certificate generated with OpenSSL when the Nginx image is built, with all HTTP traffic redirected to HTTPS
  • WordPress installed and configured by a WP-CLI script: database settings, an admin and an editor account, forced HTTPS for the admin
  • The script reads the server’s public IP from the EC2 metadata service, so the site URL is right on any new instance

From zero to a live site

  1. 1

    Create

    The first playbook creates an EC2 instance on AWS and waits for SSH.

  2. 2

    Register

    Its public IP is written into the Ansible inventory.

  3. 3

    Configure

    The second playbook installs Docker and copies the stack to the server.

  4. 4

    Start

    Docker Compose builds and starts Nginx, WordPress and MariaDB.

  5. 5

    Live

    WordPress configures itself and the site answers over HTTPS.