go to the instance using SSH

Edit the apache site config:

sudo vim /etc/apache2/sites-available/000-default.conf

Create the root directory for each site

mkdir -p /var/www/domain.com/public_html

Grant permissions

chmod -R 755 /var/www

Add <VirtualHost *:> for each new site (one after another):

<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/domain.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Disable the website and re-enable it and restart

sudo a2dissite 000-default.conf && sudo ap2ensite 000-default.conf && sudo systemctl reload apache2

Download and install wordpress in each folder and setup a database

If it is a subdomain, add the records pointing to the host ip