Create a Lightsail database

A Lightsail managed database runs MySQL or PostgreSQL for you: AWS installs the engine, applies patches, and takes daily backups. WordPress stores its posts and settings in this database, so you create it first. It takes about 10–15 minutes to become available, and you deploy the WordPress instance while it starts.

  1. Open the Lightsail console. In the left menu, choose Databases, then choose Create database.

Databases page

  1. Under Select a Region, choose Singapore (ap-southeast-1). Keep the default Availability Zone.

Select the Region

  1. Under Pick your database, choose MySQL and keep the latest 8.4 version.

Pick MySQL

  1. Do not choose Specify login credentials. Lightsail then creates the user dbmasteruser and a strong password, and stores the password for you. In the next chapters you read it with the AWS CLI, so you never copy it by hand.

  2. Choose Specify the master database name and enter wordpress. Lightsail adds the prefix db, so the database name is dbwordpress.

Master database name

  1. Under Choose your database plan, keep Standard and choose the USD 15 plan (1 GB memory, 2 vCPUs, 40 GB SSD).

Database plan

High Availability plans keep a standby copy in a second Availability Zone and cost twice as much. Standard is enough for this lab.

  1. Under Identify your database, enter fcj-lightsail-db. Under Key-value tags, add the tag Project = fcj-lightsail. Choose Create database.

Name and tag

  1. The database shows Creating. Continue with the next chapter while it starts.

Database creating

  1. When the status is Available, open the database. The Connect tab shows the user name dbmasteruser, the hidden password, and the endpoint that WordPress connects to.

Connection details

A Lightsail database accepts connections only from your Lightsail resources in the same Region by default (Public mode is off). You can check this on the Networking tab.